aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-09-04 15:11:22 +0200
committerAnton Khirnov <anton@khirnov.net>2024-09-09 17:26:18 +0200
commite13592c22d480339491f3b37fb0b363591d1e165 (patch)
tree063e6578a7439907b4dd9c1b14f058129e27a344
parentbfb139bb8d100f231b38142ec8b5f1e3ea3a2768 (diff)
downloadffmpeg-e13592c22d480339491f3b37fb0b363591d1e165.tar.gz
lavfi/af_loudnorm: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
-rw-r--r--libavfilter/af_loudnorm.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/libavfilter/af_loudnorm.c b/libavfilter/af_loudnorm.c
index d28c4556df..d63a713818 100644
--- a/libavfilter/af_loudnorm.c
+++ b/libavfilter/af_loudnorm.c
@@ -728,7 +728,9 @@ static int activate(AVFilterContext *ctx)
return FFERROR_NOT_READY;
}
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
{
LoudNormContext *s = ctx->priv;
static const int input_srate[] = {192000, -1};
@@ -736,19 +738,16 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE
};
- int ret = ff_set_common_all_channel_counts(ctx);
- if (ret < 0)
- return ret;
+ int ret;
- ret = ff_set_common_formats_from_list(ctx, sample_fmts);
+ ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts);
if (ret < 0)
return ret;
- if (s->frame_type == LINEAR_MODE) {
- return ff_set_common_all_samplerates(ctx);
- } else {
- return ff_set_common_samplerates_from_list(ctx, input_srate);
+ if (s->frame_type != LINEAR_MODE) {
+ return ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, input_srate);
}
+ return 0;
}
static int config_input(AVFilterLink *inlink)
@@ -937,5 +936,5 @@ const AVFilter ff_af_loudnorm = {
.uninit = uninit,
FILTER_INPUTS(avfilter_af_loudnorm_inputs),
FILTER_OUTPUTS(ff_audio_default_filterpad),
- FILTER_QUERY_FUNC(query_formats),
+ FILTER_QUERY_FUNC2(query_formats),
};