mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 02:20:07 +01:00
lavfi: regroup formats lists in a single structure.
It will allow to refernce it as a whole without clunky macros. Most of the changes have been automatically made with sed: sed -i ' s/-> *in_formats/->incfg.formats/g; s/-> *out_formats/->outcfg.formats/g; s/-> *in_channel_layouts/->incfg.channel_layouts/g; s/-> *out_channel_layouts/->outcfg.channel_layouts/g; s/-> *in_samplerates/->incfg.samplerates/g; s/-> *out_samplerates/->outcfg.samplerates/g; ' src/libavfilter/*(.)
This commit is contained in:
@@ -87,25 +87,25 @@ static int query_formats(AVFilterContext *ctx)
|
||||
|
||||
/* Set the output formats */
|
||||
formats = ff_all_formats(type);
|
||||
if ((ret = ff_formats_ref(formats, &ctx->outputs[idx]->in_formats)) < 0)
|
||||
if ((ret = ff_formats_ref(formats, &ctx->outputs[idx]->incfg.formats)) < 0)
|
||||
return ret;
|
||||
|
||||
if (type == AVMEDIA_TYPE_AUDIO) {
|
||||
rates = ff_all_samplerates();
|
||||
if ((ret = ff_formats_ref(rates, &ctx->outputs[idx]->in_samplerates)) < 0)
|
||||
if ((ret = ff_formats_ref(rates, &ctx->outputs[idx]->incfg.samplerates)) < 0)
|
||||
return ret;
|
||||
layouts = ff_all_channel_layouts();
|
||||
if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[idx]->in_channel_layouts)) < 0)
|
||||
if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[idx]->incfg.channel_layouts)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Set the same formats for each corresponding input */
|
||||
for (seg = 0; seg < cat->nb_segments; seg++) {
|
||||
if ((ret = ff_formats_ref(formats, &ctx->inputs[idx]->out_formats)) < 0)
|
||||
if ((ret = ff_formats_ref(formats, &ctx->inputs[idx]->outcfg.formats)) < 0)
|
||||
return ret;
|
||||
if (type == AVMEDIA_TYPE_AUDIO) {
|
||||
if ((ret = ff_formats_ref(rates, &ctx->inputs[idx]->out_samplerates)) < 0 ||
|
||||
(ret = ff_channel_layouts_ref(layouts, &ctx->inputs[idx]->out_channel_layouts)) < 0)
|
||||
if ((ret = ff_formats_ref(rates, &ctx->inputs[idx]->outcfg.samplerates)) < 0 ||
|
||||
(ret = ff_channel_layouts_ref(layouts, &ctx->inputs[idx]->outcfg.channel_layouts)) < 0)
|
||||
return ret;
|
||||
}
|
||||
idx += ctx->nb_outputs;
|
||||
|
||||
Reference in New Issue
Block a user