diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-09-04 14:43:33 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-09-09 17:26:17 +0200 |
commit | 0ec382f4948e3b60ac36e433f294b5c200945f11 (patch) | |
tree | 5b3d9df5a7f5202ae1ec8dfdf2ebd54e83d8c6be /libavfilter/af_haas.c | |
parent | 408587c83673e8cff71ed77ecc87ea00a2f4bd5c (diff) | |
download | ffmpeg-0ec382f4948e3b60ac36e433f294b5c200945f11.tar.gz |
lavfi/af_haas: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
Diffstat (limited to 'libavfilter/af_haas.c')
-rw-r--r-- | libavfilter/af_haas.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/libavfilter/af_haas.c b/libavfilter/af_haas.c index 6385b328e4..6726c85298 100644 --- a/libavfilter/af_haas.c +++ b/libavfilter/af_haas.c @@ -81,19 +81,29 @@ static const AVOption haas_options[] = { 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; - AVFilterChannelLayouts *layout = NULL; + static const enum AVSampleFormat formats[] = { + AV_SAMPLE_FMT_DBL, + AV_SAMPLE_FMT_NONE, + }; + static const AVChannelLayout layouts[] = { + AV_CHANNEL_LAYOUT_STEREO, + { .nb_channels = 0 }, + }; int ret; - if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_DBL )) < 0 || - (ret = ff_set_common_formats (ctx , formats )) < 0 || - (ret = ff_add_channel_layout (&layout , &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 || - (ret = ff_set_common_channel_layouts (ctx , layout )) < 0) + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats); + if (ret < 0) 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) @@ -216,5 +226,5 @@ const AVFilter ff_af_haas = { .uninit = uninit, FILTER_INPUTS(inputs), FILTER_OUTPUTS(ff_audio_default_filterpad), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; |