diff mbox series

[FFmpeg-devel,07/13] lavfi/af_arls: convert to query_func2()

Message ID 20240902135013.13803-7-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/13] lavfi/af_agate: convert to 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 Sept. 2, 2024, 1:50 p.m. UTC
Also, drop redundant calls that also happen implicitly in generic code.
---
 libavfilter/af_arls.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/af_arls.c b/libavfilter/af_arls.c
index de50da6473..3f182454e4 100644
--- a/libavfilter/af_arls.c
+++ b/libavfilter/af_arls.c
@@ -84,9 +84,11 @@  static const AVOption arls_options[] = {
 
 AVFILTER_DEFINE_CLASS(arls);
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+                         AVFilterFormatsConfig **cfg_in,
+                         AVFilterFormatsConfig **cfg_out)
 {
-    AudioRLSContext *s = ctx->priv;
+    const AudioRLSContext *s = ctx->priv;
     static const enum AVSampleFormat sample_fmts[3][3] = {
         { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE },
         { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE },
@@ -94,13 +96,11 @@  static int query_formats(AVFilterContext *ctx)
     };
     int ret;
 
-    if ((ret = ff_set_common_all_channel_counts(ctx)) < 0)
+    if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out,
+                                                sample_fmts[s->precision])) < 0)
         return ret;
 
-    if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts[s->precision])) < 0)
-        return ret;
-
-    return ff_set_common_all_samplerates(ctx);
+    return 0;
 }
 
 static int activate(AVFilterContext *ctx)
@@ -291,7 +291,7 @@  const AVFilter ff_af_arls = {
     .activate       = activate,
     FILTER_INPUTS(inputs),
     FILTER_OUTPUTS(outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_QUERY_FUNC2(query_formats),
     .flags          = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
                       AVFILTER_FLAG_SLICE_THREADS,
     .process_command = ff_filter_process_command,