forked from FFmpeg/FFmpeg
lavfi/af_haas: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
This commit is contained in:
parent
408587c836
commit
0ec382f494
1 changed files with 19 additions and 9 deletions
|
@ -81,19 +81,29 @@ static const AVOption haas_options[] = {
|
||||||
|
|
||||||
AVFILTER_DEFINE_CLASS(haas);
|
AVFILTER_DEFINE_CLASS(haas);
|
||||||
|
|
||||||
static int query_formats(AVFilterContext *ctx)
|
static int query_formats(const AVFilterContext *ctx,
|
||||||
|
AVFilterFormatsConfig **cfg_in,
|
||||||
|
AVFilterFormatsConfig **cfg_out)
|
||||||
{
|
{
|
||||||
AVFilterFormats *formats = NULL;
|
static const enum AVSampleFormat formats[] = {
|
||||||
AVFilterChannelLayouts *layout = NULL;
|
AV_SAMPLE_FMT_DBL,
|
||||||
|
AV_SAMPLE_FMT_NONE,
|
||||||
|
};
|
||||||
|
static const AVChannelLayout layouts[] = {
|
||||||
|
AV_CHANNEL_LAYOUT_STEREO,
|
||||||
|
{ .nb_channels = 0 },
|
||||||
|
};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_DBL )) < 0 ||
|
ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats);
|
||||||
(ret = ff_set_common_formats (ctx , formats )) < 0 ||
|
if (ret < 0)
|
||||||
(ret = ff_add_channel_layout (&layout , &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 ||
|
|
||||||
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0)
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return ff_set_common_all_samplerates(ctx);
|
ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int config_input(AVFilterLink *inlink)
|
static int config_input(AVFilterLink *inlink)
|
||||||
|
@ -216,5 +226,5 @@ const AVFilter ff_af_haas = {
|
||||||
.uninit = uninit,
|
.uninit = uninit,
|
||||||
FILTER_INPUTS(inputs),
|
FILTER_INPUTS(inputs),
|
||||||
FILTER_OUTPUTS(ff_audio_default_filterpad),
|
FILTER_OUTPUTS(ff_audio_default_filterpad),
|
||||||
FILTER_QUERY_FUNC(query_formats),
|
FILTER_QUERY_FUNC2(query_formats),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue