aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2013-05-21 17:39:27 +0200
committerJanne Grunau <janne-libav@jannau.net>2013-05-22 15:40:12 +0200
commit3eae9b030cbbdc263f69834b791624613032d548 (patch)
tree93f8912c117398acb0335dd471c0fd5172c9ab87
parent5b2b0b912dbcd6ee8b598254b083c58d4847ef02 (diff)
downloadffmpeg-3eae9b030cbbdc263f69834b791624613032d548.tar.gz
mpegvideo: unref buffers in ff_mpeg_unref_picture on frame size changes
ff_mpeg_unref_picture clears the flag indicating that the frame needs to be reallocated after a frame size change. Since we have now reference counted buffers we can unref the buffers immediately.
-rw-r--r--libavcodec/mpegvideo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index b175d32ff1..c9a425abfa 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -435,6 +435,9 @@ void ff_mpeg_unref_picture(MpegEncContext *s, Picture *pic)
av_buffer_unref(&pic->hwaccel_priv_buf);
+ if (pic->needs_realloc)
+ free_picture_tables(pic);
+
memset((uint8_t*)pic + off, 0, sizeof(*pic) - off);
}