diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-16 20:48:00 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-17 21:20:59 +0200 |
commit | 515e7fbce1cc555d9eaadad798d3d968ff468987 (patch) | |
tree | 58e67a3e4d10e2a9af1a6f22170363acb5313df4 /libavfilter/avfilter.c | |
parent | 1e35744a4ce57925d5134cdd1f1e704e9e211270 (diff) |
avfilter/avfilter: Remove unused feature to add pads in the middle
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 15 |
1 files changed, 4 insertions, 11 deletions
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; } |