diff mbox series

[FFmpeg-devel,4/8] lavfi/af_acrossover: convert to query_func2()

Message ID 20240829085052.533-4-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,1/8] lavfi: add query_func2() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Aug. 29, 2024, 8:50 a.m. UTC
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
---
 libavfilter/af_acrossover.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c
index 48ff002006..3fd5c1d246 100644
--- a/libavfilter/af_acrossover.c
+++ b/libavfilter/af_acrossover.c
@@ -108,9 +108,11 @@  static const AVOption acrossover_options[] = {
 
 AVFILTER_DEFINE_CLASS(acrossover);
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+                         AVFilterFormatsConfig **cfg_in,
+                         AVFilterFormatsConfig **cfg_out)
 {
-    AudioCrossoverContext *s = ctx->priv;
+    const AudioCrossoverContext *s = ctx->priv;
     static const enum AVSampleFormat auto_sample_fmts[] = {
         AV_SAMPLE_FMT_FLTP,
         AV_SAMPLE_FMT_DBLP,
@@ -121,9 +123,7 @@  static int query_formats(AVFilterContext *ctx)
         AV_SAMPLE_FMT_NONE
     };
     const enum AVSampleFormat *sample_fmts_list = sample_fmts;
-    int ret = ff_set_common_all_channel_counts(ctx);
-    if (ret < 0)
-        return ret;
+    int ret;
 
     switch (s->precision) {
     case 0:
@@ -138,11 +138,11 @@  static int query_formats(AVFilterContext *ctx)
     default:
         break;
     }
-    ret = ff_set_common_formats_from_list(ctx, sample_fmts_list);
+    ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts_list);
     if (ret < 0)
         return ret;
 
-    return ff_set_common_all_samplerates(ctx);
+    return 0;
 }
 
 static int parse_gains(AVFilterContext *ctx)
@@ -627,7 +627,7 @@  const AVFilter ff_af_acrossover = {
     .uninit         = uninit,
     FILTER_INPUTS(inputs),
     .outputs        = NULL,
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_QUERY_FUNC2(query_formats),
     .flags          = AVFILTER_FLAG_DYNAMIC_OUTPUTS |
                       AVFILTER_FLAG_SLICE_THREADS,
 };