[vlc-devel] commit: avcodec: do not flush buffers if codec hasn't been opened ( Rafaël Carré )

git version control git at videolan.org
Mon Oct 26 13:56:24 CET 2009


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Mon Oct 26 13:55:24 2009 +0100| [097759016d089bb4bb17ea6d28ad3448f137ea5d] | committer: Rafaël Carré 

avcodec: do not flush buffers if codec hasn't been opened

Reported-by: Konstantin Pavlov (thresh)

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

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

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index ea37291..e1e4686 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -715,7 +715,9 @@ void EndVideoDec( decoder_t *p_dec )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    avcodec_flush_buffers( p_sys->p_context );
+    /* do not flush buffers if codec hasn't been opened (theora/vorbis/VC1) */
+    if( p_sys->p_context->codec )
+        avcodec_flush_buffers( p_sys->p_context );
 
     if( p_sys->p_ff_pic ) av_free( p_sys->p_ff_pic );
 




More information about the vlc-devel mailing list