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

git at videolan.org git at videolan.org
Mon May 17 01:00:40 CEST 2010


vlc/vlc-1.1 | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat May 15 23:27:22 2010 +0200| [d66fb13db9dd87d2ca48df4d0fa6df2e8942ba16] | committer: Jean-Baptiste Kempf 

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.

Manually cherry-picked from 4979e6d702eab1973dfee025c492bb3f945363e0 by jb
Please, double check

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

 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 e3a87dc..40cbce7 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -430,10 +430,10 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         p_sys->input_pts = p_sys->input_dts = 0;
         p_sys->i_late_frames = 0;
 
-        block_Release( p_block );
+        if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
+            avcodec_flush_buffers( p_sys->p_context );
 
-        //if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
-            //avcodec_flush_buffers( p_sys->p_context );
+        block_Release( p_block );
         return NULL;
     }
 



More information about the vlc-commits mailing list