[vlc-commits] Revert "avcodec: video: unref frames instead of free"

Thomas Guillem git at videolan.org
Wed Sep 7 15:52:36 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Sep  7 15:37:53 2016 +0200| [551fbd55268020ce25cf3032bd5d84fecb0becbc] | committer: Thomas Guillem

Revert "avcodec: video: unref frames instead of free"

av_frame_free() should be used with frames allocated with av_frame_alloc().

This reverts commit e08e6f2f937271dd8aebd31abac8dc3067049ac3.

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

 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 f236224..6fcb2a2 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -857,7 +857,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         /* Nothing to display */
         if( not_received_frame )
         {
-            av_frame_unref(frame);
+            av_frame_free(&frame);
             if( i_used == 0 ) break;
             continue;
         }
@@ -880,7 +880,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_unref(frame);
+            av_frame_free(&frame);
             continue;
         }
 
@@ -896,7 +896,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
 
             if( !p_pic )
             {
-                av_frame_unref(frame);
+                av_frame_free(&frame);
                 break;
             }
 
@@ -932,7 +932,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_unref(frame);
+        av_frame_free(&frame);
 
         /* Send decoded frame to vout */
         if (i_pts > VLC_TS_INVALID)



More information about the vlc-commits mailing list