[vlc-commits] commit: Flush avcodec on discontinuity. (Laurent Aimar )

git at videolan.org git at videolan.org
Sun May 16 20:39:15 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat May 15 23:27:22 2010 +0200| [4979e6d702eab1973dfee025c492bb3f945363e0] | committer: Laurent Aimar 

Flush avcodec on discontinuity.

It is needed to be sure that the first image displayed after a discontinuity
(flush or seek) is the right one.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4979e6d702eab1973dfee025c492bb3f945363e0
---

 modules/codec/avcodec/video.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index ad71de5..0b8ce63 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -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;
     }
 



More information about the vlc-commits mailing list