History

avfilter/avfilter: Remove unused feature to add pads in the middle

Andreas Rheinhardt committed 5 years ago

Commit 515e7fb1 parent 1e3574434 files · +56 −69Browse files

Showing the changes to libavfilter/avfilter.c (1 of 34 files). Show all

Unified · Split

libavfilter/avfilter.c+4−11
@@ -101,18 +101,16 @@ void ff_command_queue_pop(AVFilterContext *filter) · 100 unmodified lines
101101 av_free(c);
102102 }
103103
104−int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
104+int ff_append_pad(unsigned *count,
105105 AVFilterPad **pads, AVFilterLink ***links,
106106 AVFilterPad *newpad)
107107 {
108108 AVFilterLink **newlinks;
109109 AVFilterPad *newpads;
110− unsigned i;
111−
112− idx = FFMIN(idx, *count);
110+ unsigned idx = *count;
113111
114− newpads = av_realloc_array(*pads, *count + 1, sizeof(AVFilterPad));
115− newlinks = av_realloc_array(*links, *count + 1, sizeof(AVFilterLink*));
112+ newpads = av_realloc_array(*pads, idx + 1, sizeof(*newpads));
113+ newlinks = av_realloc_array(*links, idx + 1, sizeof(*newlinks));
116114 if (newpads)
117115 *pads = newpads;
118116 if (newlinks)
@@ -120,15 +118,10 @@ int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, · 1 unmodified line
120118 if (!newpads || !newlinks)
121119 return AVERROR(ENOMEM);
122120
123− memmove(*pads + idx + 1, *pads + idx, sizeof(AVFilterPad) * (*count - idx));
124− memmove(*links + idx + 1, *links + idx, sizeof(AVFilterLink*) * (*count - idx));
125121 memcpy(*pads + idx, newpad, sizeof(AVFilterPad));
126122 (*links)[idx] = NULL;
127123
128124 (*count)++;
129− for (i = idx + 1; i < *count; i++)
130− if ((*links)[i])
131− (*(unsigned *)((uint8_t *) (*links)[i] + padidx_off))++;
132125
133126 return 0;
134127 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t