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>
This commit is contained in:
Andreas Rheinhardt 2021-08-16 20:48:00 +02:00
parent 1e35744a4c
commit 515e7fbce1
34 changed files with 56 additions and 69 deletions

View file

@ -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;
unsigned idx = *count;
idx = FFMIN(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;
}