1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avfilter/split: Free outpads' names generically

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-08-11 22:02:44 +02:00
parent a79852f1c1
commit 0ce19ecd28

View File

@ -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,