]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9704: [mod_av] Seeking video files with mod_av after it reaches the end does not...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 16 Mar 2017 22:43:09 +0000 (17:43 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 16 Mar 2017 22:43:09 +0000 (17:43 -0500)
src/mod/applications/mod_av/avformat.c
src/mod/applications/mod_conference/conference_video.c

index 8b678e845f0e7d059d46ba512c2672a986982d60..43e2d8c40b0135c3a7b0218b65b6f31a906dd05f 100644 (file)
@@ -2178,6 +2178,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;
@@ -2213,7 +2214,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;
        }
@@ -2496,7 +2497,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
                }
                context->vid_ready = 1;
        }
-
+       if (!frame->img) context->closed = 1;
        return frame->img ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
 }
 #endif
index ee6914f27bb220ec503dbc0cfb2a34c27e1189a7..b8a8fdfb7ae5e82c1454fe8b041f8e6ee69bbe3f 100644 (file)
@@ -910,6 +910,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg,
                                }
 
                                switch_img_patch(layer->img, layer->overlay_img, 0, 0);
+                                                
                        }
                        switch_mutex_unlock(layer->overlay_mutex);