Unified · Split
| @@ -191,7 +191,7 @@ static av_cold int init(AVFilterContext *ctx) · 190 unmodified lines | |||
| 191 | return AVERROR(ENOMEM); | 191 | return AVERROR(ENOMEM); |
| 192 | pad.name = name; | 192 | pad.name = name; |
| 193 | 193 | ||
| 194 | if ((ret = ff_insert_outpad(ctx, i, &pad)) < 0) { | 194 | if ((ret = ff_append_outpad(ctx, &pad)) < 0) { |
| 195 | av_freep(&pad.name); | 195 | av_freep(&pad.name); |
| 196 | return ret; | 196 | return ret; |
| 197 | } | 197 | } |
| @@ -836,7 +836,7 @@ static av_cold int init(AVFilterContext *ctx) · 835 unmodified lines | |||
| 836 | .type = AVMEDIA_TYPE_AUDIO, | 836 | .type = AVMEDIA_TYPE_AUDIO, |
| 837 | }; | 837 | }; |
| 838 | 838 | ||
| 839 | ret = ff_insert_inpad(ctx, 0, &pad); | 839 | ret = ff_append_inpad(ctx, &pad); |
| 840 | if (ret < 0) | 840 | if (ret < 0) |
| 841 | return ret; | 841 | return ret; |
| 842 | 842 | ||
| @@ -849,7 +849,7 @@ static av_cold int init(AVFilterContext *ctx) · 6 unmodified lines | |||
| 849 | if (!pad.name) | 849 | if (!pad.name) |
| 850 | return AVERROR(ENOMEM); | 850 | return AVERROR(ENOMEM); |
| 851 | 851 | ||
| 852 | ret = ff_insert_inpad(ctx, n + 1, &pad); | 852 | ret = ff_append_inpad(ctx, &pad); |
| 853 | if (ret < 0) { | 853 | if (ret < 0) { |
| 854 | av_freep(&pad.name); | 854 | av_freep(&pad.name); |
| 855 | return ret; | 855 | return ret; |
| @@ -862,7 +862,7 @@ static av_cold int init(AVFilterContext *ctx) · 6 unmodified lines | |||
| 862 | .config_props = config_output, | 862 | .config_props = config_output, |
| 863 | }; | 863 | }; |
| 864 | 864 | ||
| 865 | ret = ff_insert_outpad(ctx, 0, &pad); | 865 | ret = ff_append_outpad(ctx, &pad); |
| 866 | if (ret < 0) | 866 | if (ret < 0) |
| 867 | return ret; | 867 | return ret; |
| 868 | 868 | ||
| @@ -873,7 +873,7 @@ static av_cold int init(AVFilterContext *ctx) · 4 unmodified lines | |||
| 873 | .config_props = config_video, | 873 | .config_props = config_video, |
| 874 | }; | 874 | }; |
| 875 | 875 | ||
| 876 | ret = ff_insert_outpad(ctx, 1, &vpad); | 876 | ret = ff_append_outpad(ctx, &vpad); |
| 877 | if (ret < 0) | 877 | if (ret < 0) |
| 878 | return ret; | 878 | return ret; |
| 879 | } | 879 | } |
| @@ -1473,7 +1473,7 @@ static av_cold int init(AVFilterContext *ctx) · 1472 unmodified lines | |||
| 1473 | .config_props = config_output, | 1473 | .config_props = config_output, |
| 1474 | }; | 1474 | }; |
| 1475 | 1475 | ||
| 1476 | ret = ff_insert_outpad(ctx, 0, &pad); | 1476 | ret = ff_append_outpad(ctx, &pad); |
| 1477 | if (ret < 0) | 1477 | if (ret < 0) |
| 1478 | return ret; | 1478 | return ret; |
| 1479 | 1479 | ||
| @@ -1484,7 +1484,7 @@ static av_cold int init(AVFilterContext *ctx) · 4 unmodified lines | |||
| 1484 | .config_props = config_video, | 1484 | .config_props = config_video, |
| 1485 | }; | 1485 | }; |
| 1486 | 1486 | ||
| 1487 | ret = ff_insert_outpad(ctx, 1, &vpad); | 1487 | ret = ff_append_outpad(ctx, &vpad); |
| 1488 | if (ret < 0) | 1488 | if (ret < 0) |
| 1489 | return ret; | 1489 | return ret; |
| 1490 | } | 1490 | } |
| @@ -328,7 +328,7 @@ static av_cold int init(AVFilterContext *ctx) · 327 unmodified lines | |||
| 328 | }; | 328 | }; |
| 329 | if (!name) | 329 | if (!name) |
| 330 | return AVERROR(ENOMEM); | 330 | return AVERROR(ENOMEM); |
| 331 | if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) { | 331 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) { |
| 332 | av_freep(&pad.name); | 332 | av_freep(&pad.name); |
| 333 | return ret; | 333 | return ret; |
| 334 | } | 334 | } |
| @@ -553,7 +553,7 @@ static av_cold int init(AVFilterContext *ctx) · 552 unmodified lines | |||
| 553 | if (!pad.name) | 553 | if (!pad.name) |
| 554 | return AVERROR(ENOMEM); | 554 | return AVERROR(ENOMEM); |
| 555 | 555 | ||
| 556 | if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) { | 556 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) { |
| 557 | av_freep(&pad.name); | 557 | av_freep(&pad.name); |
| 558 | return ret; | 558 | return ret; |
| 559 | } | 559 | } |
| @@ -196,7 +196,7 @@ static av_cold int init(AVFilterContext *ctx) · 195 unmodified lines | |||
| 196 | .type = AVMEDIA_TYPE_AUDIO, | 196 | .type = AVMEDIA_TYPE_AUDIO, |
| 197 | }; | 197 | }; |
| 198 | 198 | ||
| 199 | ret = ff_insert_outpad(ctx, 0, &pad); | 199 | ret = ff_append_outpad(ctx, &pad); |
| 200 | if (ret < 0) | 200 | if (ret < 0) |
| 201 | return ret; | 201 | return ret; |
| 202 | 202 | ||
| @@ -206,7 +206,7 @@ static av_cold int init(AVFilterContext *ctx) · 3 unmodified lines | |||
| 206 | .type = AVMEDIA_TYPE_VIDEO, | 206 | .type = AVMEDIA_TYPE_VIDEO, |
| 207 | .config_props = config_video, | 207 | .config_props = config_video, |
| 208 | }; | 208 | }; |
| 209 | ret = ff_insert_outpad(ctx, 1, &vpad); | 209 | ret = ff_append_outpad(ctx, &vpad); |
| 210 | if (ret < 0) | 210 | if (ret < 0) |
| 211 | return ret; | 211 | return ret; |
| 212 | } | 212 | } |
| @@ -97,9 +97,8 @@ static av_cold int init(AVFilterContext *ctx) · 96 unmodified lines | |||
| 97 | s->map[i] = ret; | 97 | s->map[i] = ret; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | if ((ret = ff_insert_outpad(ctx, i, &pad)) < 0) { | 100 | if ((ret = ff_append_outpad(ctx, &pad)) < 0) |
| 101 | return ret; | 101 | return ret; |
| 102 | } | ||
| 103 | } | 102 | } |
| 104 | 103 | ||
| 105 | fail: | 104 | fail: |
| @@ -652,7 +652,7 @@ static av_cold int init(AVFilterContext *ctx) · 651 unmodified lines | |||
| 652 | .type = AVMEDIA_TYPE_AUDIO, | 652 | .type = AVMEDIA_TYPE_AUDIO, |
| 653 | .config_props = config_input, | 653 | .config_props = config_input, |
| 654 | }; | 654 | }; |
| 655 | if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0) | 655 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 656 | return ret; | 656 | return ret; |
| 657 | 657 | ||
| 658 | if (!s->map) { | 658 | if (!s->map) { |
| @@ -670,7 +670,7 @@ static av_cold int init(AVFilterContext *ctx) · 11 unmodified lines | |||
| 670 | }; | 670 | }; |
| 671 | if (!name) | 671 | if (!name) |
| 672 | return AVERROR(ENOMEM); | 672 | return AVERROR(ENOMEM); |
| 673 | if ((ret = ff_insert_inpad(ctx, i + 1, &pad)) < 0) { | 673 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) { |
| 674 | av_freep(&pad.name); | 674 | av_freep(&pad.name); |
| 675 | return ret; | 675 | return ret; |
| 676 | } | 676 | } |
| @@ -194,7 +194,7 @@ static av_cold int join_init(AVFilterContext *ctx) · 193 unmodified lines | |||
| 194 | if (!pad.name) | 194 | if (!pad.name) |
| 195 | return AVERROR(ENOMEM); | 195 | return AVERROR(ENOMEM); |
| 196 | 196 | ||
| 197 | if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) { | 197 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) { |
| 198 | av_freep(&pad.name); | 198 | av_freep(&pad.name); |
| 199 | return ret; | 199 | return ret; |
| 200 | } | 200 | } |
| @@ -639,7 +639,7 @@ static av_cold int init(AVFilterContext *ctx) · 638 unmodified lines | |||
| 639 | 639 | ||
| 640 | pad.filter_frame = filter_frame; | 640 | pad.filter_frame = filter_frame; |
| 641 | pad.config_props = config_input; | 641 | pad.config_props = config_input; |
| 642 | if (ff_insert_inpad(ctx, ctx->nb_inputs, &pad) < 0) { | 642 | if (ff_append_inpad(ctx, &pad) < 0) { |
| 643 | av_freep(&pad.name); | 643 | av_freep(&pad.name); |
| 644 | return AVERROR(ENOMEM); | 644 | return AVERROR(ENOMEM); |
| 645 | } | 645 | } |
| @@ -464,7 +464,7 @@ static av_cold int init(AVFilterContext *ctx) · 463 unmodified lines | |||
| 464 | return AVERROR(ENOMEM); | 464 | return AVERROR(ENOMEM); |
| 465 | 465 | ||
| 466 | pad.filter_frame = filter_frame; | 466 | pad.filter_frame = filter_frame; |
| 467 | if (ff_insert_inpad(ctx, ctx->nb_inputs, &pad) < 0) { | 467 | if (ff_append_inpad(ctx, &pad) < 0) { |
| 468 | av_freep(&pad.name); | 468 | av_freep(&pad.name); |
| 469 | return AVERROR(ENOMEM); | 469 | return AVERROR(ENOMEM); |
| 470 | } | 470 | } |
| @@ -355,7 +355,7 @@ static av_cold int init(AVFilterContext *ctx) · 354 unmodified lines | |||
| 355 | .name = "out0", | 355 | .name = "out0", |
| 356 | .type = AVMEDIA_TYPE_AUDIO, | 356 | .type = AVMEDIA_TYPE_AUDIO, |
| 357 | }; | 357 | }; |
| 358 | ret = ff_insert_outpad(ctx, 0, &pad); | 358 | ret = ff_append_outpad(ctx, &pad); |
| 359 | if (ret < 0) | 359 | if (ret < 0) |
| 360 | return ret; | 360 | return ret; |
| 361 | 361 | ||
| @@ -365,7 +365,7 @@ static av_cold int init(AVFilterContext *ctx) · 3 unmodified lines | |||
| 365 | .type = AVMEDIA_TYPE_VIDEO, | 365 | .type = AVMEDIA_TYPE_VIDEO, |
| 366 | .config_props = config_video_output, | 366 | .config_props = config_video_output, |
| 367 | }; | 367 | }; |
| 368 | ret = ff_insert_outpad(ctx, 1, &pad); | 368 | ret = ff_append_outpad(ctx, &pad); |
| 369 | if (ret < 0) | 369 | if (ret < 0) |
| 370 | return ret; | 370 | return ret; |
| 371 | } | 371 | } |
| @@ -319,7 +319,7 @@ static av_cold int init(AVFilterContext *ctx) · 318 unmodified lines | |||
| 319 | else | 319 | else |
| 320 | pad.get_buffer.audio = get_audio_buffer; | 320 | pad.get_buffer.audio = get_audio_buffer; |
| 321 | pad.name = av_asprintf("in%d:%c%d", seg, "va"[type], str); | 321 | pad.name = av_asprintf("in%d:%c%d", seg, "va"[type], str); |
| 322 | if ((ret = ff_insert_inpad(ctx, ctx->nb_inputs, &pad)) < 0) { | 322 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) { |
| 323 | av_freep(&pad.name); | 323 | av_freep(&pad.name); |
| 324 | return ret; | 324 | return ret; |
| 325 | } | 325 | } |
| @@ -334,7 +334,7 @@ static av_cold int init(AVFilterContext *ctx) · 8 unmodified lines | |||
| 334 | .config_props = config_output, | 334 | .config_props = config_output, |
| 335 | }; | 335 | }; |
| 336 | pad.name = av_asprintf("out:%c%d", "va"[type], str); | 336 | pad.name = av_asprintf("out:%c%d", "va"[type], str); |
| 337 | if ((ret = ff_insert_outpad(ctx, ctx->nb_outputs, &pad)) < 0) { | 337 | if ((ret = ff_append_outpad(ctx, &pad)) < 0) { |
| 338 | av_freep(&pad.name); | 338 | av_freep(&pad.name); |
| 339 | return ret; | 339 | return ret; |
| 340 | } | 340 | } |
| @@ -101,18 +101,16 @@ void ff_command_queue_pop(AVFilterContext *filter) · 100 unmodified lines | |||
| 101 | av_free(c); | 101 | av_free(c); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, | 104 | int ff_append_pad(unsigned *count, |
| 105 | AVFilterPad **pads, AVFilterLink ***links, | 105 | AVFilterPad **pads, AVFilterLink ***links, |
| 106 | AVFilterPad *newpad) | 106 | AVFilterPad *newpad) |
| 107 | { | 107 | { |
| 108 | AVFilterLink **newlinks; | 108 | AVFilterLink **newlinks; |
| 109 | AVFilterPad *newpads; | 109 | AVFilterPad *newpads; |
| 110 | unsigned i; | 110 | unsigned idx = *count; |
| 111 | |||
| 112 | idx = FFMIN(idx, *count); | ||
| 113 | 111 | ||
| 114 | newpads = av_realloc_array(*pads, *count + 1, sizeof(AVFilterPad)); | 112 | newpads = av_realloc_array(*pads, idx + 1, sizeof(*newpads)); |
| 115 | newlinks = av_realloc_array(*links, *count + 1, sizeof(AVFilterLink*)); | 113 | newlinks = av_realloc_array(*links, idx + 1, sizeof(*newlinks)); |
| 116 | if (newpads) | 114 | if (newpads) |
| 117 | *pads = newpads; | 115 | *pads = newpads; |
| 118 | if (newlinks) | 116 | if (newlinks) |
| @@ -120,15 +118,10 @@ int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, · 1 unmodified line | |||
| 120 | if (!newpads || !newlinks) | 118 | if (!newpads || !newlinks) |
| 121 | return AVERROR(ENOMEM); | 119 | return AVERROR(ENOMEM); |
| 122 | 120 | ||
| 123 | memmove(*pads + idx + 1, *pads + idx, sizeof(AVFilterPad) * (*count - idx)); | ||
| 124 | memmove(*links + idx + 1, *links + idx, sizeof(AVFilterLink*) * (*count - idx)); | ||
| 125 | memcpy(*pads + idx, newpad, sizeof(AVFilterPad)); | 121 | memcpy(*pads + idx, newpad, sizeof(AVFilterPad)); |
| 126 | (*links)[idx] = NULL; | 122 | (*links)[idx] = NULL; |
| 127 | 123 | ||
| 128 | (*count)++; | 124 | (*count)++; |
| 129 | for (i = idx + 1; i < *count; i++) | ||
| 130 | if ((*links)[i]) | ||
| 131 | (*(unsigned *)((uint8_t *) (*links)[i] + padidx_off))++; | ||
| 132 | 125 | ||
| 133 | return 0; | 126 | return 0; |
| 134 | } | 127 | } |
| @@ -552,7 +552,7 @@ static av_cold int init(AVFilterContext *ctx) · 551 unmodified lines | |||
| 552 | .type = AVMEDIA_TYPE_VIDEO, | 552 | .type = AVMEDIA_TYPE_VIDEO, |
| 553 | .config_props = config_video_output, | 553 | .config_props = config_video_output, |
| 554 | }; | 554 | }; |
| 555 | ret = ff_insert_outpad(ctx, 0, &pad); | 555 | ret = ff_append_outpad(ctx, &pad); |
| 556 | if (ret < 0) | 556 | if (ret < 0) |
| 557 | return ret; | 557 | return ret; |
| 558 | } | 558 | } |
| @@ -561,7 +561,7 @@ static av_cold int init(AVFilterContext *ctx) · 2 unmodified lines | |||
| 561 | .type = AVMEDIA_TYPE_AUDIO, | 561 | .type = AVMEDIA_TYPE_AUDIO, |
| 562 | .config_props = config_audio_output, | 562 | .config_props = config_audio_output, |
| 563 | }; | 563 | }; |
| 564 | ret = ff_insert_outpad(ctx, ebur128->do_video, &pad); | 564 | ret = ff_append_outpad(ctx, &pad); |
| 565 | if (ret < 0) | 565 | if (ret < 0) |
| 566 | return ret; | 566 | return ret; |
| 567 | 567 | ||
| @@ -173,7 +173,7 @@ static av_cold int init(AVFilterContext *ctx) · 172 unmodified lines | |||
| 173 | default: | 173 | default: |
| 174 | av_assert0(0); | 174 | av_assert0(0); |
| 175 | } | 175 | } |
| 176 | if ((ret = ff_insert_inpad(ctx, i, &inpad)) < 0) { | 176 | if ((ret = ff_append_inpad(ctx, &inpad)) < 0) { |
| 177 | av_freep(&inpad.name); | 177 | av_freep(&inpad.name); |
| 178 | return ret; | 178 | return ret; |
| 179 | } | 179 | } |
| @@ -137,7 +137,7 @@ static av_cold int init(AVFilterContext *ctx, enum AVMediaType type) · 136 unmodified lines | |||
| 137 | if (!pad.name) | 137 | if (!pad.name) |
| 138 | return AVERROR(ENOMEM); | 138 | return AVERROR(ENOMEM); |
| 139 | 139 | ||
| 140 | if ((ret = ff_insert_outpad(ctx, i, &pad)) < 0) { | 140 | if ((ret = ff_append_outpad(ctx, &pad)) < 0) { |
| 141 | av_freep(&pad.name); | 141 | av_freep(&pad.name); |
| 142 | return ret; | 142 | return ret; |
| 143 | } | 143 | } |
| @@ -192,7 +192,7 @@ static av_cold int init(AVFilterContext *ctx) · 191 unmodified lines | |||
| 192 | return AVERROR(ENOMEM); | 192 | return AVERROR(ENOMEM); |
| 193 | pad.type = ctx->filter->inputs[0].type; | 193 | pad.type = ctx->filter->inputs[0].type; |
| 194 | pad.request_frame = request_frame; | 194 | pad.request_frame = request_frame; |
| 195 | if ((ret = ff_insert_outpad(ctx, i, &pad)) < 0) { | 195 | if ((ret = ff_append_outpad(ctx, &pad)) < 0) { |
| 196 | av_freep(&pad.name); | 196 | av_freep(&pad.name); |
| 197 | return ret; | 197 | return ret; |
| 198 | } | 198 | } |
| @@ -167,10 +167,10 @@ static int parse_definition(AVFilterContext *ctx, int nb_pads, int is_input, int · 166 unmodified lines | |||
| 167 | av_log(ctx, AV_LOG_DEBUG, "Add %s pad %s\n", padtype, pad.name); | 167 | av_log(ctx, AV_LOG_DEBUG, "Add %s pad %s\n", padtype, pad.name); |
| 168 | 168 | ||
| 169 | if (is_input) { | 169 | if (is_input) { |
| 170 | ret = ff_insert_inpad(ctx, i, &pad); | 170 | ret = ff_append_inpad(ctx, &pad); |
| 171 | } else { | 171 | } else { |
| 172 | pad.config_props = config_output; | 172 | pad.config_props = config_output; |
| 173 | ret = ff_insert_outpad(ctx, i, &pad); | 173 | ret = ff_append_outpad(ctx, &pad); |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | if (ret < 0) { | 176 | if (ret < 0) { |
| @@ -226,34 +226,29 @@ void ff_tlog_link(void *ctx, AVFilterLink *link, int end); · 225 unmodified lines | |||
| 226 | /** | 226 | /** |
| 227 | * Insert a new pad. | 227 | * Insert a new pad. |
| 228 | * | 228 | * |
| 229 | * @param idx Insertion point. Pad is inserted at the end if this point | ||
| 230 | * is beyond the end of the list of pads. | ||
| 231 | * @param count Pointer to the number of pads in the list | 229 | * @param count Pointer to the number of pads in the list |
| 232 | * @param padidx_off Offset within an AVFilterLink structure to the element | ||
| 233 | * to increment when inserting a new pad causes link | ||
| 234 | * numbering to change | ||
| 235 | * @param pads Pointer to the pointer to the beginning of the list of pads | 230 | * @param pads Pointer to the pointer to the beginning of the list of pads |
| 236 | * @param links Pointer to the pointer to the beginning of the list of links | 231 | * @param links Pointer to the pointer to the beginning of the list of links |
| 237 | * @param newpad The new pad to add. A copy is made when adding. | 232 | * @param newpad The new pad to add. A copy is made when adding. |
| 238 | * @return >= 0 in case of success, a negative AVERROR code on error | 233 | * @return >= 0 in case of success, a negative AVERROR code on error |
| 239 | */ | 234 | */ |
| 240 | int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, | 235 | int ff_append_pad(unsigned *count, |
| 241 | AVFilterPad **pads, AVFilterLink ***links, | 236 | AVFilterPad **pads, AVFilterLink ***links, |
| 242 | AVFilterPad *newpad); | 237 | AVFilterPad *newpad); |
| 243 | 238 | ||
| 244 | /** Insert a new input pad for the filter. */ | 239 | /** Insert a new input pad for the filter. */ |
| 245 | static inline int ff_insert_inpad(AVFilterContext *f, unsigned index, | 240 | static inline int ff_append_inpad(AVFilterContext *f, |
| 246 | AVFilterPad *p) | 241 | AVFilterPad *p) |
| 247 | { | 242 | { |
| 248 | return ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad), | 243 | return ff_append_pad(&f->nb_inputs, |
| 249 | &f->input_pads, &f->inputs, p); | 244 | &f->input_pads, &f->inputs, p); |
| 250 | } | 245 | } |
| 251 | 246 | ||
| 252 | /** Insert a new output pad for the filter. */ | 247 | /** Insert a new output pad for the filter. */ |
| 253 | static inline int ff_insert_outpad(AVFilterContext *f, unsigned index, | 248 | static inline int ff_append_outpad(AVFilterContext *f, |
| 254 | AVFilterPad *p) | 249 | AVFilterPad *p) |
| 255 | { | 250 | { |
| 256 | return ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad), | 251 | return ff_append_pad(&f->nb_outputs, |
| 257 | &f->output_pads, &f->outputs, p); | 252 | &f->output_pads, &f->outputs, p); |
| 258 | } | 253 | } |
| 259 | 254 | ||
| @@ -56,7 +56,7 @@ static av_cold int split_init(AVFilterContext *ctx) · 55 unmodified lines | |||
| 56 | if (!pad.name) | 56 | if (!pad.name) |
| 57 | return AVERROR(ENOMEM); | 57 | return AVERROR(ENOMEM); |
| 58 | 58 | ||
| 59 | if ((ret = ff_insert_outpad(ctx, i, &pad)) < 0) { | 59 | if ((ret = ff_append_outpad(ctx, &pad)) < 0) { |
| 60 | av_freep(&pad.name); | 60 | av_freep(&pad.name); |
| 61 | return ret; | 61 | return ret; |
| 62 | } | 62 | } |
| @@ -306,7 +306,7 @@ static av_cold int movie_common_init(AVFilterContext *ctx) · 305 unmodified lines | |||
| 306 | return AVERROR(ENOMEM); | 306 | return AVERROR(ENOMEM); |
| 307 | pad.config_props = movie_config_output_props; | 307 | pad.config_props = movie_config_output_props; |
| 308 | pad.request_frame = movie_request_frame; | 308 | pad.request_frame = movie_request_frame; |
| 309 | if ((ret = ff_insert_outpad(ctx, i, &pad)) < 0) { | 309 | if ((ret = ff_append_outpad(ctx, &pad)) < 0) { |
| 310 | av_freep(&pad.name); | 310 | av_freep(&pad.name); |
| 311 | return ret; | 311 | return ret; |
| 312 | } | 312 | } |
| @@ -941,7 +941,7 @@ static av_cold int init(AVFilterContext *ctx) · 940 unmodified lines | |||
| 941 | pad.name = "source"; | 941 | pad.name = "source"; |
| 942 | pad.config_props = config_input; | 942 | pad.config_props = config_input; |
| 943 | 943 | ||
| 944 | if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0) | 944 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 945 | return ret; | 945 | return ret; |
| 946 | 946 | ||
| 947 | if (s->ref) { | 947 | if (s->ref) { |
| @@ -949,7 +949,7 @@ static av_cold int init(AVFilterContext *ctx) · 1 unmodified line | |||
| 949 | pad.name = "reference"; | 949 | pad.name = "reference"; |
| 950 | pad.config_props = NULL; | 950 | pad.config_props = NULL; |
| 951 | 951 | ||
| 952 | if ((ret = ff_insert_inpad(ctx, 1, &pad)) < 0) | 952 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 953 | return ret; | 953 | return ret; |
| 954 | } | 954 | } |
| 955 | 955 | ||
| @@ -310,13 +310,13 @@ static av_cold int decimate_init(AVFilterContext *ctx) · 309 unmodified lines | |||
| 310 | }; | 310 | }; |
| 311 | int ret; | 311 | int ret; |
| 312 | 312 | ||
| 313 | if ((ret = ff_insert_inpad(ctx, INPUT_MAIN, &pad)) < 0) | 313 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 314 | return ret; | 314 | return ret; |
| 315 | 315 | ||
| 316 | if (dm->ppsrc) { | 316 | if (dm->ppsrc) { |
| 317 | pad.name = "clean_src"; | 317 | pad.name = "clean_src"; |
| 318 | pad.config_props = NULL; | 318 | pad.config_props = NULL; |
| 319 | if ((ret = ff_insert_inpad(ctx, INPUT_CLEANSRC, &pad)) < 0) | 319 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 320 | return ret; | 320 | return ret; |
| 321 | } | 321 | } |
| 322 | 322 | ||
| @@ -352,7 +352,7 @@ static av_cold int init(AVFilterContext *ctx) · 351 unmodified lines | |||
| 352 | pad.type = AVMEDIA_TYPE_VIDEO; | 352 | pad.type = AVMEDIA_TYPE_VIDEO; |
| 353 | pad.config_props = config_output; | 353 | pad.config_props = config_output; |
| 354 | 354 | ||
| 355 | if ((ret = ff_insert_outpad(ctx, ctx->nb_outputs, &pad)) < 0) { | 355 | if ((ret = ff_append_outpad(ctx, &pad)) < 0) { |
| 356 | av_freep(&pad.name); | 356 | av_freep(&pad.name); |
| 357 | return ret; | 357 | return ret; |
| 358 | } | 358 | } |
| @@ -970,13 +970,13 @@ static av_cold int fieldmatch_init(AVFilterContext *ctx) · 969 unmodified lines | |||
| 970 | }; | 970 | }; |
| 971 | int ret; | 971 | int ret; |
| 972 | 972 | ||
| 973 | if ((ret = ff_insert_inpad(ctx, INPUT_MAIN, &pad)) < 0) | 973 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 974 | return ret; | 974 | return ret; |
| 975 | 975 | ||
| 976 | if (fm->ppsrc) { | 976 | if (fm->ppsrc) { |
| 977 | pad.name = "clean_src"; | 977 | pad.name = "clean_src"; |
| 978 | pad.config_props = NULL; | 978 | pad.config_props = NULL; |
| 979 | if ((ret = ff_insert_inpad(ctx, INPUT_CLEANSRC, &pad)) < 0) | 979 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 980 | return ret; | 980 | return ret; |
| 981 | } | 981 | } |
| 982 | 982 | ||
| @@ -442,7 +442,7 @@ static av_cold int init(AVFilterContext *ctx) · 441 unmodified lines | |||
| 442 | pad.name = "source"; | 442 | pad.name = "source"; |
| 443 | pad.config_props = config_input; | 443 | pad.config_props = config_input; |
| 444 | 444 | ||
| 445 | if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0) | 445 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 446 | return ret; | 446 | return ret; |
| 447 | 447 | ||
| 448 | if (s->guidance == ON) { | 448 | if (s->guidance == ON) { |
| @@ -450,7 +450,7 @@ static av_cold int init(AVFilterContext *ctx) · 1 unmodified line | |||
| 450 | pad.name = "guidance"; | 450 | pad.name = "guidance"; |
| 451 | pad.config_props = NULL; | 451 | pad.config_props = NULL; |
| 452 | 452 | ||
| 453 | if ((ret = ff_insert_inpad(ctx, 1, &pad)) < 0) | 453 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 454 | return ret; | 454 | return ret; |
| 455 | } | 455 | } |
| 456 | 456 | ||
| @@ -96,7 +96,7 @@ static av_cold int init(AVFilterContext *ctx) · 95 unmodified lines | |||
| 96 | if (!pad.name) | 96 | if (!pad.name) |
| 97 | return AVERROR(ENOMEM); | 97 | return AVERROR(ENOMEM); |
| 98 | 98 | ||
| 99 | if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0){ | 99 | if ((ret = ff_append_inpad(ctx, &pad)) < 0){ |
| 100 | av_freep(&pad.name); | 100 | av_freep(&pad.name); |
| 101 | return ret; | 101 | return ret; |
| 102 | } | 102 | } |
| @@ -125,7 +125,7 @@ static av_cold int init(AVFilterContext *ctx) · 124 unmodified lines | |||
| 125 | if (!pad.name) | 125 | if (!pad.name) |
| 126 | return AVERROR(ENOMEM); | 126 | return AVERROR(ENOMEM); |
| 127 | 127 | ||
| 128 | if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) { | 128 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) { |
| 129 | av_freep(&pad.name); | 129 | av_freep(&pad.name); |
| 130 | return ret; | 130 | return ret; |
| 131 | } | 131 | } |
| @@ -790,7 +790,7 @@ static av_cold int init(AVFilterContext *ctx) · 789 unmodified lines | |||
| 790 | pad.name = "main"; | 790 | pad.name = "main"; |
| 791 | pad.config_props = config_input; | 791 | pad.config_props = config_input; |
| 792 | 792 | ||
| 793 | if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0) | 793 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 794 | return ret; | 794 | return ret; |
| 795 | 795 | ||
| 796 | if (!s->inplace) { | 796 | if (!s->inplace) { |
| @@ -798,7 +798,7 @@ static av_cold int init(AVFilterContext *ctx) · 1 unmodified line | |||
| 798 | pad.name = "alpha"; | 798 | pad.name = "alpha"; |
| 799 | pad.config_props = NULL; | 799 | pad.config_props = NULL; |
| 800 | 800 | ||
| 801 | if ((ret = ff_insert_inpad(ctx, 1, &pad)) < 0) | 801 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) |
| 802 | return ret; | 802 | return ret; |
| 803 | } | 803 | } |
| 804 | 804 | ||
| @@ -287,7 +287,7 @@ static av_cold int program_opencl_init(AVFilterContext *avctx) · 286 unmodified lines | |||
| 287 | 287 | ||
| 288 | input.config_props = &ff_opencl_filter_config_input; | 288 | input.config_props = &ff_opencl_filter_config_input; |
| 289 | 289 | ||
| 290 | err = ff_insert_inpad(avctx, i, &input); | 290 | err = ff_append_inpad(avctx, &input); |
| 291 | if (err < 0) { | 291 | if (err < 0) { |
| 292 | av_freep(&input.name); | 292 | av_freep(&input.name); |
| 293 | return err; | 293 | return err; |
| @@ -664,7 +664,7 @@ static av_cold int init(AVFilterContext *ctx) · 663 unmodified lines | |||
| 664 | 664 | ||
| 665 | if (!pad.name) | 665 | if (!pad.name) |
| 666 | return AVERROR(ENOMEM); | 666 | return AVERROR(ENOMEM); |
| 667 | if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) { | 667 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) { |
| 668 | av_freep(&pad.name); | 668 | av_freep(&pad.name); |
| 669 | return ret; | 669 | return ret; |
| 670 | } | 670 | } |
| @@ -123,7 +123,7 @@ static av_cold int init(AVFilterContext *ctx) · 122 unmodified lines | |||
| 123 | if (!pad.name) | 123 | if (!pad.name) |
| 124 | return AVERROR(ENOMEM); | 124 | return AVERROR(ENOMEM); |
| 125 | 125 | ||
| 126 | if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) { | 126 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) { |
| 127 | av_freep(&pad.name); | 127 | av_freep(&pad.name); |
| 128 | return ret; | 128 | return ret; |
| 129 | } | 129 | } |
| @@ -118,7 +118,7 @@ static av_cold int init(AVFilterContext *ctx) · 117 unmodified lines | |||
| 118 | if (!pad.name) | 118 | if (!pad.name) |
| 119 | return AVERROR(ENOMEM); | 119 | return AVERROR(ENOMEM); |
| 120 | 120 | ||
| 121 | if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) { | 121 | if ((ret = ff_append_inpad(ctx, &pad)) < 0) { |
| 122 | av_freep(&pad.name); | 122 | av_freep(&pad.name); |
| 123 | return ret; | 123 | return ret; |
| 124 | } | 124 | } |