avfilter/af_agate: Store format in filter, remove query function

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-09-27 14:24:56 +02:00
parent 5c36cb2ebf
commit 0e42f12ec6

View File

@ -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,
};