[FFmpeg-cvslog] mpegvideo: unref buffers in ff_mpeg_unref_picture on frame size changes
Janne Grunau
git at videolan.org
Thu May 23 10:30:11 CEST 2013
ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Tue May 21 17:39:27 2013 +0200| [3eae9b030cbbdc263f69834b791624613032d548] | committer: Janne Grunau
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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3eae9b030cbbdc263f69834b791624613032d548
---
libavcodec/mpegvideo.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index b175d32..c9a425a 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);
}
More information about the ffmpeg-cvslog
mailing list