Commit aba8065a authored by Nicolas George's avatar Nicolas George

avfiltergraph: call query_formats on inputs first.

This is a temporary workaround for amerge,
until format renegociation is implemented.

Should fix trac ticket #1400.
parent 6a4c5c73
...@@ -235,8 +235,14 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) ...@@ -235,8 +235,14 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
AVFilterFormats *samplerates; AVFilterFormats *samplerates;
int scaler_count = 0, resampler_count = 0; int scaler_count = 0, resampler_count = 0;
for (j = 0; j < 2; j++) {
/* ask all the sub-filters for their supported media formats */ /* ask all the sub-filters for their supported media formats */
for (i = 0; i < graph->filter_count; i++) { for (i = 0; i < graph->filter_count; i++) {
/* Call query_formats on sources first.
This is a temporary workaround for amerge,
until format renegociation is implemented. */
if (!graph->filters[i]->input_count == j)
continue;
if (graph->filters[i]->filter->query_formats) if (graph->filters[i]->filter->query_formats)
ret = graph->filters[i]->filter->query_formats(graph->filters[i]); ret = graph->filters[i]->filter->query_formats(graph->filters[i]);
else else
...@@ -244,6 +250,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) ...@@ -244,6 +250,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
}
/* go through and merge as many format lists as possible */ /* go through and merge as many format lists as possible */
for (i = 0; i < graph->filter_count; i++) { for (i = 0; i < graph->filter_count; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment