[FFmpeg-cvslog] asvenc: free avctx->coded_frame on codec close
Janne Grunau
git at videolan.org
Sun Feb 9 23:42:55 CET 2014
ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Sat Feb 8 12:26:13 2014 +0100| [6a8475dc4f10d65edb7faa8df6e035af0ddcce19] | committer: Janne Grunau
asvenc: free avctx->coded_frame on codec close
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a8475dc4f10d65edb7faa8df6e035af0ddcce19
---
libavcodec/asvenc.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index 40257f0..6c83c92 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -263,6 +263,12 @@ static av_cold int encode_init(AVCodecContext *avctx){
return 0;
}
+static av_cold int asv_encode_close(AVCodecContext *avctx)
+{
+ av_frame_free(&avctx->coded_frame);
+
+ return 0;
+}
#if CONFIG_ASV1_ENCODER
AVCodec ff_asv1_encoder = {
@@ -273,6 +279,7 @@ AVCodec ff_asv1_encoder = {
.priv_data_size = sizeof(ASV1Context),
.init = encode_init,
.encode2 = encode_frame,
+ .close = asv_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
};
@@ -287,6 +294,7 @@ AVCodec ff_asv2_encoder = {
.priv_data_size = sizeof(ASV1Context),
.init = encode_init,
.encode2 = encode_frame,
+ .close = asv_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
};
More information about the ffmpeg-cvslog
mailing list