[FFmpeg-devel] [PATCH 12/23] avfilter/f_select: Free outpads' names generically

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


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

diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index f0468078e8..0538ee347d 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -192,10 +192,8 @@ static av_cold int init(AVFilterContext *ctx)
             return AVERROR(ENOMEM);
         pad.type = ctx->filter->inputs[0].type;
         pad.request_frame = request_frame;
-        if ((ret = ff_insert_outpad(ctx, i, &pad)) < 0) {
-            av_freep(&pad.name);
+        if ((ret = ff_insert_outpad(ctx, i, &pad)) < 0)
             return ret;
-        }
     }
 
     return 0;
@@ -432,14 +430,10 @@ static int request_frame(AVFilterLink *outlink)
 static av_cold void uninit(AVFilterContext *ctx)
 {
     SelectContext *select = ctx->priv;
-    int i;
 
     av_expr_free(select->expr);
     select->expr = NULL;
 
-    for (i = 0; i < ctx->nb_outputs; i++)
-        av_freep(&ctx->output_pads[i].name);
-
     if (select->do_scene_detect) {
         av_frame_free(&select->prev_picref);
     }
@@ -485,6 +479,7 @@ const AVFilter ff_af_aselect = {
     .inputs      = avfilter_af_aselect_inputs,
     .priv_class  = &aselect_class,
     .flags       = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
+    .flags_internal = FF_FILTER_FLAG_FREE_OUTPADS,
 };
 #endif /* CONFIG_ASELECT_FILTER */
 
@@ -550,5 +545,6 @@ const AVFilter ff_vf_select = {
     .priv_class    = &select_class,
     .inputs        = avfilter_vf_select_inputs,
     .flags         = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
+    .flags_internal = FF_FILTER_FLAG_FREE_OUTPADS,
 };
 #endif /* CONFIG_SELECT_FILTER */
-- 
2.30.2



More information about the ffmpeg-devel mailing list