mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-17 20:37:04 +00:00
lavfi/af_pan: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
This commit is contained in:
parent
b38f4e7f86
commit
691e0a1082
@ -243,31 +243,24 @@ fail:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int query_formats(AVFilterContext *ctx)
|
static int query_formats(const AVFilterContext *ctx,
|
||||||
|
AVFilterFormatsConfig **cfg_in,
|
||||||
|
AVFilterFormatsConfig **cfg_out)
|
||||||
{
|
{
|
||||||
const PanContext *pan = ctx->priv;
|
const PanContext *pan = ctx->priv;
|
||||||
AVFilterLink *inlink = ctx->inputs[0];
|
|
||||||
AVFilterLink *outlink = ctx->outputs[0];
|
|
||||||
AVFilterChannelLayouts *layouts;
|
AVFilterChannelLayouts *layouts;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* libswr supports any sample and packing formats */
|
|
||||||
if ((ret = ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_AUDIO))) < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if ((ret = ff_set_common_all_samplerates(ctx)) < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
// inlink supports any channel layout
|
// inlink supports any channel layout
|
||||||
layouts = ff_all_channel_counts();
|
layouts = ff_all_channel_counts();
|
||||||
if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0)
|
if ((ret = ff_channel_layouts_ref(layouts, &cfg_in[0]->channel_layouts)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
// outlink supports only requested output channel layout
|
// outlink supports only requested output channel layout
|
||||||
layouts = NULL;
|
layouts = NULL;
|
||||||
if ((ret = ff_add_channel_layout(&layouts, &pan->out_channel_layout)) < 0)
|
if ((ret = ff_add_channel_layout(&layouts, &pan->out_channel_layout)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
return ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts);
|
return ff_channel_layouts_ref(layouts, &cfg_out[0]->channel_layouts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int config_props(AVFilterLink *link)
|
static int config_props(AVFilterLink *link)
|
||||||
@ -432,5 +425,5 @@ const AVFilter ff_af_pan = {
|
|||||||
.uninit = uninit,
|
.uninit = uninit,
|
||||||
FILTER_INPUTS(pan_inputs),
|
FILTER_INPUTS(pan_inputs),
|
||||||
FILTER_OUTPUTS(ff_audio_default_filterpad),
|
FILTER_OUTPUTS(ff_audio_default_filterpad),
|
||||||
FILTER_QUERY_FUNC(query_formats),
|
FILTER_QUERY_FUNC2(query_formats),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user