[FFmpeg-devel] [PATCH 11/23] avfilter/f_interleave: Free inpads' names generically

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu Aug 12 04:43:45 EEST 2021


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavfilter/f_interleave.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/libavfilter/f_interleave.c b/libavfilter/f_interleave.c
index 259952b591..b2c0305797 100644
--- a/libavfilter/f_interleave.c
+++ b/libavfilter/f_interleave.c
@@ -173,21 +173,13 @@ static av_cold int init(AVFilterContext *ctx)
         default:
             av_assert0(0);
         }
-        if ((ret = ff_insert_inpad(ctx, i, &inpad)) < 0) {
-            av_freep(&inpad.name);
+        if ((ret = ff_insert_inpad(ctx, i, &inpad)) < 0)
             return ret;
-        }
     }
 
     return 0;
 }
 
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    for (int i = 0; i < ctx->nb_inputs; i++)
-        av_freep(&ctx->input_pads[i].name);
-}
-
 static int config_output(AVFilterLink *outlink)
 {
     AVFilterContext *ctx = outlink->src;
@@ -243,11 +235,11 @@ const AVFilter ff_vf_interleave = {
     .description = NULL_IF_CONFIG_SMALL("Temporally interleave video inputs."),
     .priv_size   = sizeof(InterleaveContext),
     .init        = init,
-    .uninit      = uninit,
     .activate    = activate,
     .outputs     = interleave_outputs,
     .priv_class  = &interleave_class,
     .flags       = AVFILTER_FLAG_DYNAMIC_INPUTS,
+    .flags_internal = FF_FILTER_FLAG_FREE_INPADS,
 };
 
 #endif
@@ -271,11 +263,11 @@ const AVFilter ff_af_ainterleave = {
     .description = NULL_IF_CONFIG_SMALL("Temporally interleave audio inputs."),
     .priv_size   = sizeof(InterleaveContext),
     .init        = init,
-    .uninit      = uninit,
     .activate    = activate,
     .outputs     = ainterleave_outputs,
     .priv_class  = &ainterleave_class,
     .flags       = AVFILTER_FLAG_DYNAMIC_INPUTS,
+    .flags_internal = FF_FILTER_FLAG_FREE_INPADS,
 };
 
 #endif
-- 
2.30.2



More information about the ffmpeg-devel mailing list