From 9837aa936bdb21e03ca12e51217ab9376e474ef6 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 17 Mar 2017 15:31:10 -0500 Subject: [PATCH] FS-10152: [mod_shout] seek from eof to 0 not working in mod_shout #resolve --- src/mod/formats/mod_shout/mod_shout.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mod/formats/mod_shout/mod_shout.c b/src/mod/formats/mod_shout/mod_shout.c index b736042abb..27d2a003a0 100644 --- a/src/mod/formats/mod_shout/mod_shout.c +++ b/src/mod/formats/mod_shout/mod_shout.c @@ -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); } + switch_mutex_lock(context->audio_mutex); switch_buffer_zero(context->audio_buffer); + switch_mutex_unlock(context->audio_mutex); + seek_samples = mpg123_seek(context->mh, (off_t) samples, whence); if (seek_samples >= 0) { + context->eof = 0; handle->pos = *cur_sample = seek_samples; return SWITCH_STATUS_SUCCESS; }