[vlc-devel] [PATCH 2/9] avcodec: video: unref frames instead of free

ileoo at videolan.org ileoo at videolan.org
Sun Sep 4 14:34:02 CEST 2016


From: Ilkka Ollakka <ileoo at videolan.org>

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

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 74024d4..c2f96c6 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -875,7 +875,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         /* Nothing to display */
         if( !b_gotpicture )
         {
-            av_frame_free(&frame);
+            av_frame_unref(frame);
             if( i_used == 0 ) break;
             continue;
         }
@@ -898,7 +898,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
 
         if( !b_need_output_picture || ( !p_sys->p_va && !frame->linesize[0] ) )
         {
-            av_frame_free(&frame);
+            av_frame_unref(frame);
             continue;
         }
 
@@ -914,7 +914,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
 
             if( !p_pic )
             {
-                av_frame_free(&frame);
+                av_frame_unref(frame);
                 break;
             }
 
@@ -950,7 +950,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         p_pic->b_progressive = !frame->interlaced_frame;
         p_pic->b_top_field_first = frame->top_field_first;
 
-        av_frame_free(&frame);
+        av_frame_unref(frame);
 
         /* Send decoded frame to vout */
         if (i_pts > VLC_TS_INVALID)
-- 
2.6.6



More information about the vlc-devel mailing list