[FFmpeg-devel] [PATCH 05/10] avfilter/af_loudnorm: Simplify setting common samplerates
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Wed Aug 11 04:17:48 EEST 2021
This filter has only one input and output, so what it does
can be more easily achieved by using ff_set_common_samplerates().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavfilter/af_loudnorm.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/libavfilter/af_loudnorm.c b/libavfilter/af_loudnorm.c
index 54a58bb9a1..8bfb5ccc74 100644
--- a/libavfilter/af_loudnorm.c
+++ b/libavfilter/af_loudnorm.c
@@ -684,9 +684,6 @@ static int request_frame(AVFilterLink *outlink)
static int query_formats(AVFilterContext *ctx)
{
LoudNormContext *s = ctx->priv;
- AVFilterFormats *formats;
- AVFilterLink *inlink = ctx->inputs[0];
- AVFilterLink *outlink = ctx->outputs[0];
static const int input_srate[] = {192000, -1};
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBL,
@@ -701,13 +698,7 @@ static int query_formats(AVFilterContext *ctx)
return ret;
if (s->frame_type != LINEAR_MODE) {
- formats = ff_make_format_list(input_srate);
- if (!formats)
- return AVERROR(ENOMEM);
- ret = ff_formats_ref(formats, &inlink->outcfg.samplerates);
- if (ret < 0)
- return ret;
- ret = ff_formats_ref(formats, &outlink->incfg.samplerates);
+ ret = ff_set_common_samplerates_from_list(ctx, input_srate);
if (ret < 0)
return ret;
}
--
2.30.2
More information about the ffmpeg-devel
mailing list