This is a temporary workaround for amerge, until format renegociation is implemented. Should fix trac ticket #1400.
Showing the changes to libavfilter/avfiltergraph.c (1 of 1 file). Show all
Unified · Split
| @@ -235,8 +235,14 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 234 unmodified lines | ||
| 235 | 235 | AVFilterFormats *samplerates; |
| 236 | 236 | int scaler_count = 0, resampler_count = 0; |
| 237 | 237 | |
| 238 | + for (j = 0; j < 2; j++) { | |
| 238 | 239 | /* ask all the sub-filters for their supported media formats */ |
| 239 | 240 | for (i = 0; i < graph->filter_count; i++) { |
| 241 | + /* Call query_formats on sources first. | |
| 242 | + This is a temporary workaround for amerge, | |
| 243 | + until format renegociation is implemented. */ | |
| 244 | + if (!graph->filters[i]->input_count == j) | |
| 245 | + continue; | |
| 240 | 246 | if (graph->filters[i]->filter->query_formats) |
| 241 | 247 | ret = graph->filters[i]->filter->query_formats(graph->filters[i]); |
| 242 | 248 | else |
| @@ -244,6 +250,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 1 unmodified line | ||
| 244 | 250 | if (ret < 0) |
| 245 | 251 | return ret; |
| 246 | 252 | } |
| 253 | + } | |
| 247 | 254 | |
| 248 | 255 | /* go through and merge as many format lists as possible */ |
| 249 | 256 | for (i = 0; i < graph->filter_count; i++) { |