diff options
author | Janne Grunau <janne-libav@jannau.net> | 2013-05-21 17:39:27 +0200 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2013-05-22 15:40:12 +0200 |
commit | 3eae9b030cbbdc263f69834b791624613032d548 (patch) | |
tree | 93f8912c117398acb0335dd471c0fd5172c9ab87 | |
parent | 5b2b0b912dbcd6ee8b598254b083c58d4847ef02 (diff) | |
download | ffmpeg-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.c | 3 |
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); } |