diff mbox series

[FFmpeg-devel,v3,16/25] avfilter/split: Free outpads' names generically

Message ID PR3PR03MB6665DC78A54804594328405B8FC39@PR3PR03MB6665.eurprd03.prod.outlook.com
State Accepted
Commit 0ce19ecd2833080b3f6bd0d9d0838e4eccb8e792
Headers show
Series [FFmpeg-devel,v3,01/25] avfilter/internal: Uninline ff_insert_(in|out)pad() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 22, 2021, 12:47 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/split.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/split.c b/libavfilter/split.c
index a77ce6f6f1..b02584d0ab 100644
--- a/libavfilter/split.c
+++ b/libavfilter/split.c
@@ -56,23 +56,13 @@  static av_cold int split_init(AVFilterContext *ctx)
         if (!pad.name)
             return AVERROR(ENOMEM);
 
-        if ((ret = ff_append_outpad(ctx, &pad)) < 0) {
-            av_freep(&pad.name);
+        if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
             return ret;
-        }
     }
 
     return 0;
 }
 
-static av_cold void split_uninit(AVFilterContext *ctx)
-{
-    int i;
-
-    for (i = 0; i < ctx->nb_outputs; i++)
-        av_freep(&ctx->output_pads[i].name);
-}
-
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 {
     AVFilterContext *ctx = inlink->dst;
@@ -124,7 +114,6 @@  const AVFilter ff_vf_split = {
     .priv_size   = sizeof(SplitContext),
     .priv_class  = &split_class,
     .init        = split_init,
-    .uninit      = split_uninit,
     FILTER_INPUTS(avfilter_vf_split_inputs),
     .outputs     = NULL,
     .flags       = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
@@ -144,7 +133,6 @@  const AVFilter ff_af_asplit = {
     .priv_size   = sizeof(SplitContext),
     .priv_class  = &asplit_class,
     .init        = split_init,
-    .uninit      = split_uninit,
     FILTER_INPUTS(avfilter_af_asplit_inputs),
     .outputs     = NULL,
     .flags       = AVFILTER_FLAG_DYNAMIC_OUTPUTS,