diff mbox series

[FFmpeg-devel,021/218] avfilter/af_amix: Use formats list instead of query function

Message ID PR3PR03MB6665346A7C803F8A774D492E8FAA9@PR3PR03MB6665.eurprd03.prod.outlook.com
State Accepted
Commit ade39d5b4ff722d27cf27a9f845fb9fb0bc8d868
Headers show
Series [FFmpeg-devel,001/218] avfilter/f_reverse: Don't use redundant query_formats function | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 30, 2021, 1:39 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/af_amix.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index d2a363284f..3f51d43acd 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -589,22 +589,6 @@  static av_cold void uninit(AVFilterContext *ctx)
     av_freep(&s->fdsp);
 }
 
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVSampleFormat sample_fmts[] = {
-        AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
-        AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
-        AV_SAMPLE_FMT_NONE
-    };
-    int ret;
-
-    if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0 ||
-        (ret = ff_set_common_all_samplerates(ctx)) < 0)
-        return ret;
-
-    return ff_set_common_all_channel_counts(ctx);
-}
-
 static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
                            char *res, int res_len, int flags)
 {
@@ -641,7 +625,8 @@  const AVFilter ff_af_amix = {
     .activate       = activate,
     .inputs         = NULL,
     FILTER_OUTPUTS(avfilter_af_amix_outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_SAMPLEFMTS(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
+                      AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP),
     .process_command = process_command,
     .flags          = AVFILTER_FLAG_DYNAMIC_INPUTS,
 };