avcodec/aacenc: add FF_CODEC_CAP_INIT_CLEANUP
authorLimin Wang <lance.lmwang@gmail.com>
Mon, 1 Jun 2020 14:29:13 +0000 (22:29 +0800)
committerLimin Wang <lance.lmwang@gmail.com>
Fri, 12 Jun 2020 22:59:18 +0000 (06:59 +0800)
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
libavcodec/aacenc.c
libavcodec/iirfilter.c

index db11e0c..189f5e0 100644 (file)
@@ -1115,7 +1115,6 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
 
     return 0;
 fail:
-    aac_encode_end(avctx);
     return ret;
 }
 
@@ -1159,7 +1158,7 @@ AVCodec ff_aac_encoder = {
     .close          = aac_encode_end,
     .defaults       = aac_encode_defaults,
     .supported_samplerates = mpeg4audio_sample_rates,
-    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
     .capabilities   = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
     .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
                                                      AV_SAMPLE_FMT_NONE },
index b202515..749fa57 100644 (file)
@@ -197,7 +197,6 @@ av_cold struct FFIIRFilterCoeffs *ff_iir_filter_init_coeffs(void *avc,
         return c;
 
 init_fail:
-    ff_iir_filter_free_coeffsp(&c);
     return NULL;
 }