From 515e7fbce1cc555d9eaadad798d3d968ff468987 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 16 Aug 2021 20:48:00 +0200 Subject: avfilter/avfilter: Remove unused feature to add pads in the middle Reviewed-by: Nicolas George Signed-off-by: Andreas Rheinhardt --- libavfilter/avfilter.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'libavfilter/avfilter.c') diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 87b44d34fe..ea22b247de 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -101,18 +101,16 @@ void ff_command_queue_pop(AVFilterContext *filter) av_free(c); } -int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, +int ff_append_pad(unsigned *count, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad) { AVFilterLink **newlinks; AVFilterPad *newpads; - unsigned i; - - idx = FFMIN(idx, *count); + unsigned idx = *count; - newpads = av_realloc_array(*pads, *count + 1, sizeof(AVFilterPad)); - newlinks = av_realloc_array(*links, *count + 1, sizeof(AVFilterLink*)); + newpads = av_realloc_array(*pads, idx + 1, sizeof(*newpads)); + newlinks = av_realloc_array(*links, idx + 1, sizeof(*newlinks)); if (newpads) *pads = newpads; if (newlinks) @@ -120,15 +118,10 @@ int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, if (!newpads || !newlinks) return AVERROR(ENOMEM); - memmove(*pads + idx + 1, *pads + idx, sizeof(AVFilterPad) * (*count - idx)); - memmove(*links + idx + 1, *links + idx, sizeof(AVFilterLink*) * (*count - idx)); memcpy(*pads + idx, newpad, sizeof(AVFilterPad)); (*links)[idx] = NULL; (*count)++; - for (i = idx + 1; i < *count; i++) - if ((*links)[i]) - (*(unsigned *)((uint8_t *) (*links)[i] + padidx_off))++; return 0; } -- cgit v1.2.3