Commit: 9df9c17d2c1686f7360d7f23cfbeea9e0dfd1e5b
Author: Sergey Sharybin
Date:   Tue Mar 15 13:39:39 2016 +0500
Branches: master
https://developer.blender.org/rB9df9c17d2c1686f7360d7f23cfbeea9e0dfd1e5b

ImBuf: Use proper function to free FFmpeg frames

===================================================================

M       source/blender/imbuf/intern/anim_movie.c

===================================================================

diff --git a/source/blender/imbuf/intern/anim_movie.c 
b/source/blender/imbuf/intern/anim_movie.c
index 05e6b25..1d7c5da 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -569,9 +569,9 @@ static int startffmpeg(struct anim *anim)
                        fprintf(stderr, "Could not allocate frame data.\n");
                        avcodec_close(anim->pCodecCtx);
                        avformat_close_input(&anim->pFormatCtx);
-                       av_free(anim->pFrameRGB);
-                       av_free(anim->pFrameDeinterlaced);
-                       av_free(anim->pFrame);
+                       av_frame_free(&anim->pFrameRGB);
+                       av_frame_free(&anim->pFrameDeinterlaced);
+                       av_frame_free(&anim->pFrame);
                        anim->pCodecCtx = NULL;
                        return -1;
                }
@@ -584,9 +584,9 @@ static int startffmpeg(struct anim *anim)
                        "ffmpeg has changed alloc scheme ... ARGHHH!\n");
                avcodec_close(anim->pCodecCtx);
                avformat_close_input(&anim->pFormatCtx);
-               av_free(anim->pFrameRGB);
-               av_free(anim->pFrameDeinterlaced);
-               av_free(anim->pFrame);
+               av_frame_free(&anim->pFrameRGB);
+               av_frame_free(&anim->pFrameDeinterlaced);
+               av_frame_free(&anim->pFrame);
                anim->pCodecCtx = NULL;
                return -1;
        }
@@ -625,9 +625,9 @@ static int startffmpeg(struct anim *anim)
                        "Can't transform color space??? Bailing out...\n");
                avcodec_close(anim->pCodecCtx);
                avformat_close_input(&anim->pFormatCtx);
-               av_free(anim->pFrameRGB);
-               av_free(anim->pFrameDeinterlaced);
-               av_free(anim->pFrame);
+               av_frame_free(&anim->pFrameRGB);
+               av_frame_free(&anim->pFrameDeinterlaced);
+               av_frame_free(&anim->pFrame);
                anim->pCodecCtx = NULL;
                return -1;
        }
@@ -1163,13 +1163,9 @@ static void free_anim_ffmpeg(struct anim *anim)
        if (anim->pCodecCtx) {
                avcodec_close(anim->pCodecCtx);
                avformat_close_input(&anim->pFormatCtx);
-               av_free(anim->pFrameRGB);
-               av_free(anim->pFrame);
-
-               if (anim->ib_flags & IB_animdeinterlace) {
-                       MEM_freeN(anim->pFrameDeinterlaced->data[0]);
-               }
-               av_free(anim->pFrameDeinterlaced);
+               av_frame_free(&anim->pFrameRGB);
+               av_frame_free(&anim->pFrame);
+               av_frame_free(&anim->pFrameDeinterlaced);
                sws_freeContext(anim->img_convert_ctx);
                IMB_freeImBuf(anim->last_frame);
                if (anim->next_packet.stream_index != -1) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to