]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7514: pop only newest frame on video file read to keep sync
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 3 Mar 2015 17:48:56 +0000 (11:48 -0600)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:47:08 +0000 (12:47 -0500)
src/mod/formats/mod_vlc/mod_vlc.c

index 3a8cdb6d740ebe8d0cd20963f58b467e82be87cf..cc95c3912167af4ed5abaa14b3e1a4e4bf51062a 100644 (file)
@@ -1025,6 +1025,14 @@ static switch_status_t vlc_file_read_video(switch_file_handle_t *handle, switch_
                return SWITCH_STATUS_FALSE;
        }
        
+       while(switch_queue_size(vcontext->video_queue) > 1) {
+               if (switch_queue_trypop(vcontext->video_queue, &pop) == SWITCH_STATUS_SUCCESS) {
+                       switch_image_t *img = (switch_image_t *) pop;
+                       switch_img_free(&img);
+               }
+       }
+
+       
        if (switch_queue_pop(vcontext->video_queue, &pop) == SWITCH_STATUS_SUCCESS) {
                if (!pop) {
                        vcontext->err = 1;