[FFmpeg-devel] [PATCH v3 07/24] avcodec/aacenc: add FF_CODEC_CAP_INIT_CLEANUP

lance.lmwang at gmail.com lance.lmwang at gmail.com
Tue Jun 2 18:16:41 EEST 2020


From: Limin Wang <lance.lmwang at gmail.com>

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavcodec/aacenc.c    | 3 +--
 libavcodec/iirfilter.c | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index db11e0c..189f5e0 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -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 },
diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c
index b202515..749fa57 100644
--- a/libavcodec/iirfilter.c
+++ b/libavcodec/iirfilter.c
@@ -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;
 }
 
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list