From 0e42f12ec60ec4604bc13e8bdbef7fc49119d35f Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 27 Sep 2021 14:24:56 +0200 Subject: [PATCH] avfilter/af_agate: Store format in filter, remove query function Signed-off-by: Andreas Rheinhardt --- libavfilter/af_agate.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/libavfilter/af_agate.c b/libavfilter/af_agate.c index ff61bad250..682f17c7dd 100644 --- a/libavfilter/af_agate.c +++ b/libavfilter/af_agate.c @@ -188,24 +188,6 @@ static void gate(AudioGateContext *s, #if CONFIG_AGATE_FILTER -static int query_formats(AVFilterContext *ctx) -{ - AVFilterFormats *formats = NULL; - int ret; - - if ((ret = ff_add_format(&formats, AV_SAMPLE_FMT_DBL)) < 0) - return ret; - ret = ff_set_common_formats(ctx, formats); - 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 int filter_frame(AVFilterLink *inlink, AVFrame *in) { const double *src = (const double *)in->data[0]; @@ -258,7 +240,7 @@ const AVFilter ff_af_agate = { .priv_size = sizeof(AudioGateContext), FILTER_INPUTS(inputs), FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_DBL), .process_command = ff_filter_process_command, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, };