Browse Source

asvenc: free avctx->coded_frame on codec close

tags/n2.2-rc1
Janne Grunau 12 years ago
parent
commit
6a8475dc4f
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      libavcodec/asvenc.c

+ 8
- 0
libavcodec/asvenc.c View File

@@ -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 },
};


Loading…
Cancel
Save