Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-03-15 11:39:39 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-03-15 11:39:39 +0300
commit9df9c17d2c1686f7360d7f23cfbeea9e0dfd1e5b (patch)
treee5152ce74a8fd4ec0871af7ec347668749c038ab
parent7ab2e73494097bcadc7738ae7aed9c201573cdb2 (diff)
ImBuf: Use proper function to free FFmpeg frames
-rw-r--r--source/blender/imbuf/intern/anim_movie.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 05e6b25b9a5..1d7c5da0c5b 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) {