[FFmpeg-cvslog] lavfi/af_arnndn: convert to query_func2()

Anton Khirnov git at videolan.org
Thu Sep 5 11:09:12 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Aug 31 11:21:00 2024 +0200| [b18f7d7e2df67d9805e6f420de5415190cd432c4] | committer: Anton Khirnov

lavfi/af_arnndn: convert to query_func2()

Also, drop redundant calls that also happen implicitly in generic code.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b18f7d7e2df67d9805e6f420de5415190cd432c4
---

 libavfilter/af_arnndn.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libavfilter/af_arnndn.c b/libavfilter/af_arnndn.c
index b29af87df9..3c2ae6370d 100644
--- a/libavfilter/af_arnndn.c
+++ b/libavfilter/af_arnndn.c
@@ -327,7 +327,9 @@ static int rnnoise_model_from_file(FILE *f, RNNModel **rnn)
     return 0;
 }
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+                         AVFilterFormatsConfig **cfg_in,
+                         AVFilterFormatsConfig **cfg_out)
 {
     static const enum AVSampleFormat sample_fmts[] = {
         AV_SAMPLE_FMT_FLTP,
@@ -335,15 +337,11 @@ static int query_formats(AVFilterContext *ctx)
     };
     int ret, sample_rates[] = { 48000, -1 };
 
-    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;
 
-    ret = ff_set_common_all_channel_counts(ctx);
-    if (ret < 0)
-        return ret;
-
-    return ff_set_common_samplerates_from_list(ctx, sample_rates);
+    return ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates);
 }
 
 static int config_input(AVFilterLink *inlink)
@@ -1608,7 +1606,7 @@ const AVFilter ff_af_arnndn = {
     .uninit        = uninit,
     FILTER_INPUTS(inputs),
     FILTER_OUTPUTS(ff_audio_default_filterpad),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_QUERY_FUNC2(query_formats),
     .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
                      AVFILTER_FLAG_SLICE_THREADS,
     .process_command = process_command,



More information about the ffmpeg-cvslog mailing list