diff mbox series

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

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

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_acontrast.c | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/af_acontrast.c b/libavfilter/af_acontrast.c
index 91c4ecd19a..db7ff79d25 100644
--- a/libavfilter/af_acontrast.c
+++ b/libavfilter/af_acontrast.c
@@ -42,26 +42,6 @@  static const AVOption acontrast_options[] = {
 
 AVFILTER_DEFINE_CLASS(acontrast);
 
-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;
-
-    ret = ff_set_common_formats_from_list(ctx, sample_fmts);
-    if (ret < 0)
-        return ret;
-
-    ret = ff_set_common_all_channel_counts(ctx);
-    if (ret < 0)
-        return ret;
-
-    return ff_set_common_all_samplerates(ctx);
-}
-
 static void filter_flt(void **d, const void **s,
                        int nb_samples, int channels,
                        float contrast)
@@ -203,5 +183,6 @@  const AVFilter ff_af_acontrast = {
     .priv_class     = &acontrast_class,
     FILTER_INPUTS(inputs),
     FILTER_OUTPUTS(outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_SAMPLEFMTS(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
+                      AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP),
 };