[vlc-commits] commit: Fixed avcodec picture reference counts. (Laurent Aimar )

git at videolan.org git at videolan.org
Fri Apr 23 21:17:05 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Apr 23 00:50:42 2010 +0200| [faba61698f7a12f201f56867116f9b2b69b69045] | committer: Laurent Aimar 

Fixed avcodec picture reference counts.

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

 modules/codec/avcodec/video.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index f257adb..425f1c7 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -607,7 +607,11 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
             /* Do not display the picture */
             p_pic = (picture_t *)p_sys->p_ff_pic->opaque;
             if( !b_drawpicture && p_pic )
+            {
+                if( p_sys->p_ff_pic->opaque )
+                    decoder_LinkPicture( p_dec, p_pic );
                 decoder_DeletePicture( p_dec, p_pic );
+            }
 
             ffmpeg_NextPts( p_dec );
             continue;
@@ -630,6 +634,7 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         else
         {
             p_pic = (picture_t *)p_sys->p_ff_pic->opaque;
+            decoder_LinkPicture( p_dec, p_pic );
         }
 
         /* Sanity check (seems to be needed for some streams) */
@@ -991,8 +996,6 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
     p_ff_pic->linesize[2] = p_pic->p[2].i_pitch;
     p_ff_pic->linesize[3] = 0;
 
-    decoder_LinkPicture( p_dec, p_pic );
-
     /* FIXME what is that, should give good value */
     p_ff_pic->age = 256*256*256*64; // FIXME FIXME from ffmpeg
 



More information about the vlc-commits mailing list