summaryrefslogtreecommitdiff
path: root/libavfilter/af_silencedetect.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-27 13:10:11 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-10-05 18:01:03 +0200
commit861aaebf7c941eef747c22fa21cd67911e2789e7 (patch)
tree4ce419b9b0f248e5c8ce8f3adc3700d6c5394bdf /libavfilter/af_silencedetect.c
parent174e7f85095afef444504a5fad0e694d468d3e13 (diff)
downloadffmpeg-861aaebf7c941eef747c22fa21cd67911e2789e7.tar.gz
avfilter/af_silencedetect: Use formats list instead of query function
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/af_silencedetect.c')
-rw-r--r--libavfilter/af_silencedetect.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c
index 482270d3f7..fa0884bee8 100644
--- a/libavfilter/af_silencedetect.c
+++ b/libavfilter/af_silencedetect.c
@@ -232,26 +232,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return ff_filter_frame(inlink->dst->outputs[0], insamples);
}
-static int query_formats(AVFilterContext *ctx)
-{
- static const enum AVSampleFormat sample_fmts[] = {
- AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
- AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
- AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P,
- AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
- AV_SAMPLE_FMT_NONE
- };
- int ret = ff_set_common_all_channel_counts(ctx);
- if (ret < 0)
- return ret;
-
- ret = ff_set_common_formats_from_list(ctx, sample_fmts);
- if (ret < 0)
- return ret;
-
- return ff_set_common_all_samplerates(ctx);
-}
-
static av_cold void uninit(AVFilterContext *ctx)
{
SilenceDetectContext *s = ctx->priv;
@@ -287,6 +267,9 @@ const AVFilter ff_af_silencedetect = {
.uninit = uninit,
FILTER_INPUTS(silencedetect_inputs),
FILTER_OUTPUTS(silencedetect_outputs),
- FILTER_QUERY_FUNC(query_formats),
+ FILTER_SAMPLEFMTS(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
+ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
+ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P,
+ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P),
.priv_class = &silencedetect_class,
};