[FFmpeg-devel] [PATCH 14/23] avfilter/split: Free outpads' names generically
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Thu Aug 12 04:43:48 EEST 2021
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavfilter/split.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/libavfilter/split.c b/libavfilter/split.c
index da5f681af8..b14f6798e9 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_insert_outpad(ctx, i, &pad)) < 0) {
- av_freep(&pad.name);
+ if ((ret = ff_insert_outpad(ctx, i, &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;
@@ -125,10 +115,10 @@ const AVFilter ff_vf_split = {
.priv_size = sizeof(SplitContext),
.priv_class = &split_class,
.init = split_init,
- .uninit = split_uninit,
.inputs = avfilter_vf_split_inputs,
.outputs = NULL,
.flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
+ .flags_internal = FF_FILTER_FLAG_FREE_OUTPADS,
};
static const AVFilterPad avfilter_af_asplit_inputs[] = {
@@ -146,8 +136,8 @@ const AVFilter ff_af_asplit = {
.priv_size = sizeof(SplitContext),
.priv_class = &asplit_class,
.init = split_init,
- .uninit = split_uninit,
.inputs = avfilter_af_asplit_inputs,
.outputs = NULL,
.flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
+ .flags_internal = FF_FILTER_FLAG_FREE_OUTPADS,
};
--
2.30.2
More information about the ffmpeg-devel
mailing list