From: Anthony Minessale Date: Thu, 16 Mar 2017 22:56:55 +0000 (-0500) Subject: FS-9704 backport of 2de527564e6079b4ddd8659cda0064e3d8eaacb1 cherry pick was beeing... X-Git-Tag: v1.6.16~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17ff4b41aea7cd8bfbb792adf6a0359a11a774f4;p=thirdparty%2Ffreeswitch.git FS-9704 backport of 2de527564e6079b4ddd8659cda0064e3d8eaacb1 cherry pick was beeing funky --- diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 127f1d40a6..2194597715 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -2093,6 +2093,7 @@ static switch_status_t av_file_seek(switch_file_handle_t *handle, unsigned int * context->seek_ts = samples / handle->native_rate * AV_TIME_BASE; *cur_sample = context->seek_ts; + context->closed = 0; if (!context->file_read_thread_running) { switch_threadattr_t *thd_attr = NULL; @@ -2128,7 +2129,7 @@ static switch_status_t av_file_read(switch_file_handle_t *handle, void *data, si } switch_mutex_unlock(context->mutex); - if (!context->file_read_thread_running && switch_buffer_inuse(context->audio_buffer) == 0) { + if (context->closed || (!context->file_read_thread_running && switch_buffer_inuse(context->audio_buffer) == 0)) { *len = 0; return SWITCH_STATUS_FALSE; } @@ -2397,7 +2398,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f if (frame->img) { context->vid_ready = 1; } - + if (!frame->img) context->closed = 1; return frame->img ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; } #endif