Unified · Split
| @@ -72,9 +72,11 @@ static const AVOption concat_options[] = { · 71 unmodified lines | ||
| 72 | 72 | |
| 73 | 73 | AVFILTER_DEFINE_CLASS(concat); |
| 74 | 74 | |
| 75 | −static int query_formats(AVFilterContext *ctx) | |
| 75 | +static int query_formats(const AVFilterContext *ctx, | |
| 76 | + AVFilterFormatsConfig **cfg_in, | |
| 77 | + AVFilterFormatsConfig **cfg_out) | |
| 76 | 78 | { |
| 77 | − ConcatContext *cat = ctx->priv; | |
| 79 | + const ConcatContext *cat = ctx->priv; | |
| 78 | 80 | unsigned type, nb_str, idx0 = 0, idx, str, seg; |
| 79 | 81 | AVFilterFormats *formats, *rates = NULL; |
| 80 | 82 | AVFilterChannelLayouts *layouts = NULL; |
| @@ -87,25 +89,25 @@ static int query_formats(AVFilterContext *ctx) · 6 unmodified lines | ||
| 87 | 89 | |
| 88 | 90 | /* Set the output formats */ |
| 89 | 91 | formats = ff_all_formats(type); |
| 90 | − if ((ret = ff_formats_ref(formats, &ctx->outputs[idx]->incfg.formats)) < 0) | |
| 92 | + if ((ret = ff_formats_ref(formats, &cfg_out[idx]->formats)) < 0) | |
| 91 | 93 | return ret; |
| 92 | 94 | |
| 93 | 95 | if (type == AVMEDIA_TYPE_AUDIO) { |
| 94 | 96 | rates = ff_all_samplerates(); |
| 95 | − if ((ret = ff_formats_ref(rates, &ctx->outputs[idx]->incfg.samplerates)) < 0) | |
| 97 | + if ((ret = ff_formats_ref(rates, &cfg_out[idx]->samplerates)) < 0) | |
| 96 | 98 | return ret; |
| 97 | 99 | layouts = ff_all_channel_layouts(); |
| 98 | − if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[idx]->incfg.channel_layouts)) < 0) | |
| 100 | + if ((ret = ff_channel_layouts_ref(layouts, &cfg_out[idx]->channel_layouts)) < 0) | |
| 99 | 101 | return ret; |
| 100 | 102 | } |
| 101 | 103 | |
| 102 | 104 | /* Set the same formats for each corresponding input */ |
| 103 | 105 | for (seg = 0; seg < cat->nb_segments; seg++) { |
| 104 | − if ((ret = ff_formats_ref(formats, &ctx->inputs[idx]->outcfg.formats)) < 0) | |
| 106 | + if ((ret = ff_formats_ref(formats, &cfg_in[idx]->formats)) < 0) | |
| 105 | 107 | return ret; |
| 106 | 108 | if (type == AVMEDIA_TYPE_AUDIO) { |
| 107 | − if ((ret = ff_formats_ref(rates, &ctx->inputs[idx]->outcfg.samplerates)) < 0 || | |
| 108 | − (ret = ff_channel_layouts_ref(layouts, &ctx->inputs[idx]->outcfg.channel_layouts)) < 0) | |
| 109 | + if ((ret = ff_formats_ref(rates, &cfg_in[idx]->samplerates)) < 0 || | |
| 110 | + (ret = ff_channel_layouts_ref(layouts, &cfg_in[idx]->channel_layouts)) < 0) | |
| 109 | 111 | return ret; |
| 110 | 112 | } |
| 111 | 113 | idx += ctx->nb_outputs; |
| @@ -460,6 +462,6 @@ const AVFilter ff_avf_concat = { · 348 unmodified lines | ||
| 460 | 462 | .outputs = NULL, |
| 461 | 463 | .priv_class = &concat_class, |
| 462 | 464 | .flags = AVFILTER_FLAG_DYNAMIC_INPUTS | AVFILTER_FLAG_DYNAMIC_OUTPUTS, |
| 463 | − FILTER_QUERY_FUNC(query_formats), | |
| 465 | + FILTER_QUERY_FUNC2(query_formats), | |
| 464 | 466 | .process_command = process_command, |
| 465 | 467 | }; |