Originally committed as revision 25235 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -122,7 +122,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, · 121 unmodified lines | |||
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, | 124 | int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, |
| 125 | unsigned in, unsigned out) | 125 | unsigned filt_srcpad_idx, unsigned filt_dstpad_idx) |
| 126 | { | 126 | { |
| 127 | int ret; | 127 | int ret; |
| 128 | unsigned dstpad_idx = link->dstpad - link->dst->input_pads; | 128 | unsigned dstpad_idx = link->dstpad - link->dst->input_pads; |
| @@ -132,7 +132,7 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, · 3 unmodified lines | |||
| 132 | filt->name, link->src->name, link->dst->name); | 132 | filt->name, link->src->name, link->dst->name); |
| 133 | 133 | ||
| 134 | link->dst->inputs[dstpad_idx] = NULL; | 134 | link->dst->inputs[dstpad_idx] = NULL; |
| 135 | if ((ret = avfilter_link(filt, out, link->dst, dstpad_idx)) < 0) { | 135 | if ((ret = avfilter_link(filt, filt_dstpad_idx, link->dst, dstpad_idx)) < 0) { |
| 136 | /* failed to link output filter to new filter */ | 136 | /* failed to link output filter to new filter */ |
| 137 | link->dst->inputs[dstpad_idx] = link; | 137 | link->dst->inputs[dstpad_idx] = link; |
| 138 | return ret; | 138 | return ret; |
| @@ -140,14 +140,14 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, · 1 unmodified line | |||
| 140 | 140 | ||
| 141 | /* re-hookup the link to the new destination filter we inserted */ | 141 | /* re-hookup the link to the new destination filter we inserted */ |
| 142 | link->dst = filt; | 142 | link->dst = filt; |
| 143 | link->dstpad = &filt->input_pads[in]; | 143 | link->dstpad = &filt->input_pads[filt_srcpad_idx]; |
| 144 | filt->inputs[in] = link; | 144 | filt->inputs[filt_srcpad_idx] = link; |
| 145 | 145 | ||
| 146 | /* if any information on supported media formats already exists on the | 146 | /* if any information on supported media formats already exists on the |
| 147 | * link, we need to preserve that */ | 147 | * link, we need to preserve that */ |
| 148 | if (link->out_formats) | 148 | if (link->out_formats) |
| 149 | avfilter_formats_changeref(&link->out_formats, | 149 | avfilter_formats_changeref(&link->out_formats, |
| 150 | &filt->outputs[out]->out_formats); | 150 | &filt->outputs[filt_dstpad_idx]->out_formats); |
| 151 | 151 | ||
| 152 | return 0; | 152 | return 0; |
| 153 | } | 153 | } |
| @@ -783,12 +783,12 @@ void avfilter_destroy(AVFilterContext *filter); · 782 unmodified lines | |||
| 783 | * | 783 | * |
| 784 | * @param link the link into which the filter should be inserted | 784 | * @param link the link into which the filter should be inserted |
| 785 | * @param filt the filter to be inserted | 785 | * @param filt the filter to be inserted |
| 786 | * @param in the input pad on the filter to connect | 786 | * @param filt_srcpad_idx the input pad on the filter to connect |
| 787 | * @param out the output pad on the filter to connect | 787 | * @param filt_dstpad_idx the output pad on the filter to connect |
| 788 | * @return zero on success | 788 | * @return zero on success |
| 789 | */ | 789 | */ |
| 790 | int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, | 790 | int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, |
| 791 | unsigned in, unsigned out); | 791 | unsigned filt_srcpad_idx, unsigned filt_dstpad_idx); |
| 792 | 792 | ||
| 793 | /** | 793 | /** |
| 794 | * Insert a new pad. | 794 | * Insert a new pad. |