提交 f19fcdb4 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-10152: [mod_shout] seek from eof to 0 not working in mod_shout #resolve

上级 1c0a6725
...@@ -935,10 +935,14 @@ static switch_status_t shout_file_seek(switch_file_handle_t *handle, unsigned in ...@@ -935,10 +935,14 @@ static switch_status_t shout_file_seek(switch_file_handle_t *handle, unsigned in
samples -= switch_buffer_inuse(context->audio_buffer) / sizeof(int16_t); samples -= switch_buffer_inuse(context->audio_buffer) / sizeof(int16_t);
} }
switch_mutex_lock(context->audio_mutex);
switch_buffer_zero(context->audio_buffer); switch_buffer_zero(context->audio_buffer);
switch_mutex_unlock(context->audio_mutex);
seek_samples = mpg123_seek(context->mh, (off_t) samples, whence); seek_samples = mpg123_seek(context->mh, (off_t) samples, whence);
if (seek_samples >= 0) { if (seek_samples >= 0) {
context->eof = 0;
handle->pos = *cur_sample = seek_samples; handle->pos = *cur_sample = seek_samples;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论