mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-20 08:27:07 +08:00
avfilter/avf_concat: Free pads' names generically
Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -319,13 +319,11 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
else
|
else
|
||||||
pad.get_buffer.audio = get_audio_buffer;
|
pad.get_buffer.audio = get_audio_buffer;
|
||||||
pad.name = av_asprintf("in%d:%c%d", seg, "va"[type], str);
|
pad.name = av_asprintf("in%d:%c%d", seg, "va"[type], str);
|
||||||
if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
|
if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
|
||||||
av_freep(&pad.name);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/* create output pads */
|
/* create output pads */
|
||||||
for (type = 0; type < TYPE_ALL; type++) {
|
for (type = 0; type < TYPE_ALL; type++) {
|
||||||
for (str = 0; str < cat->nb_streams[type]; str++) {
|
for (str = 0; str < cat->nb_streams[type]; str++) {
|
||||||
@ -334,12 +332,10 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
.config_props = config_output,
|
.config_props = config_output,
|
||||||
};
|
};
|
||||||
pad.name = av_asprintf("out:%c%d", "va"[type], str);
|
pad.name = av_asprintf("out:%c%d", "va"[type], str);
|
||||||
if ((ret = ff_append_outpad(ctx, &pad)) < 0) {
|
if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
|
||||||
av_freep(&pad.name);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
cat->in = av_calloc(ctx->nb_inputs, sizeof(*cat->in));
|
cat->in = av_calloc(ctx->nb_inputs, sizeof(*cat->in));
|
||||||
if (!cat->in)
|
if (!cat->in)
|
||||||
@ -351,12 +347,7 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
static av_cold void uninit(AVFilterContext *ctx)
|
static av_cold void uninit(AVFilterContext *ctx)
|
||||||
{
|
{
|
||||||
ConcatContext *cat = ctx->priv;
|
ConcatContext *cat = ctx->priv;
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
for (i = 0; i < ctx->nb_inputs; i++)
|
|
||||||
av_freep(&ctx->input_pads[i].name);
|
|
||||||
for (i = 0; i < ctx->nb_outputs; i++)
|
|
||||||
av_freep(&ctx->output_pads[i].name);
|
|
||||||
av_freep(&cat->in);
|
av_freep(&cat->in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user