asvenc: free avctx->coded_frame on codec close

This commit is contained in:
Janne Grunau 2014-02-08 12:26:13 +01:00
parent d6eac2f1bc
commit 6a8475dc4f
1 changed files with 8 additions and 0 deletions

View File

@ -263,6 +263,12 @@ static av_cold int encode_init(AVCodecContext *avctx){
return 0; return 0;
} }
static av_cold int asv_encode_close(AVCodecContext *avctx)
{
av_frame_free(&avctx->coded_frame);
return 0;
}
#if CONFIG_ASV1_ENCODER #if CONFIG_ASV1_ENCODER
AVCodec ff_asv1_encoder = { AVCodec ff_asv1_encoder = {
@ -273,6 +279,7 @@ AVCodec ff_asv1_encoder = {
.priv_data_size = sizeof(ASV1Context), .priv_data_size = sizeof(ASV1Context),
.init = encode_init, .init = encode_init,
.encode2 = encode_frame, .encode2 = encode_frame,
.close = asv_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE }, AV_PIX_FMT_NONE },
}; };
@ -287,6 +294,7 @@ AVCodec ff_asv2_encoder = {
.priv_data_size = sizeof(ASV1Context), .priv_data_size = sizeof(ASV1Context),
.init = encode_init, .init = encode_init,
.encode2 = encode_frame, .encode2 = encode_frame,
.close = asv_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE }, AV_PIX_FMT_NONE },
}; };