提交 3f0d6b3f authored 作者: Matteo Brancaleoni's avatar Matteo Brancaleoni

FS-6756 lame_init_params must be called after setting all id3tag stuff,…

FS-6756 lame_init_params must be called after setting all id3tag stuff, otherwise id3 tags will not be written.
So, instead of calling it early, revert FS-3646 and add a check on free_context to really do lame stuff only
if lame has been set ready, avoid seg faults in some corner cases.
上级 8e473c3c
...@@ -166,7 +166,7 @@ static inline void free_context(shout_context_t *context) ...@@ -166,7 +166,7 @@ static inline void free_context(shout_context_t *context)
mpg123_delete(context->mh); mpg123_delete(context->mh);
} }
if (context->fp) { if (context->fp && context->lame_ready) {
unsigned char mp3buffer[20480]; unsigned char mp3buffer[20480];
int len; int len;
int16_t blank[2048] = { 0 }, *r = NULL; int16_t blank[2048] = { 0 }, *r = NULL;
...@@ -854,11 +854,6 @@ static switch_status_t shout_file_open(switch_file_handle_t *handle, const char ...@@ -854,11 +854,6 @@ static switch_status_t shout_file_open(switch_file_handle_t *handle, const char
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s\n", path); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s\n", path);
goto error; goto error;
} }
if (!context->lame_ready) {
lame_init_params(context->gfp);
lame_print_config(context->gfp);
context->lame_ready = 1;
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论