From: Laurent Aimar Date: Sat, 15 May 2010 21:27:22 +0000 (+0200) Subject: Flush avcodec on discontinuity. X-Git-Tag: 1.2.0-pre1~6635 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4979e6d702eab1973dfee025c492bb3f945363e0;p=vlc 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. --- diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c index ad71de5518..0b8ce63b7c 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; }