]> git.sesse.net Git - vlc/commitdiff
Flush avcodec on discontinuity.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 15 May 2010 21:27:22 +0000 (23:27 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 16 May 2010 18:37:34 +0000 (20:37 +0200)
It is needed to be sure that the first image displayed after a discontinuity
(flush or seek) is the right one.

modules/codec/avcodec/video.c

index ad71de551861451404798060f74b93bd4aafd956..0b8ce63b7cd01af933535cb36ba6d1d5842fd45a 100644 (file)
@@ -451,10 +451,10 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
 
         p_sys->i_late_frames = 0;
 
-        block_Release( p_block );
+        if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
+            avcodec_flush_buffers( p_context );
 
-        //if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
-            //avcodec_flush_buffers( p_context );
+        block_Release( p_block );
         return NULL;
     }