From e076d8a9b3893886e7c7abd67cf715db40788a44 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 13 May 2023 10:39:41 +0200 Subject: [PATCH] avfilter/af_asetrate: extend query_formats() It left some formats not defined. Causing format negotiation errors with ffplay. Fixes #9248 --- libavfilter/af_asetrate.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_asetrate.c b/libavfilter/af_asetrate.c index 76f29144e5..f1e48b7087 100644 --- a/libavfilter/af_asetrate.c +++ b/libavfilter/af_asetrate.c @@ -49,7 +49,17 @@ AVFILTER_DEFINE_CLASS(asetrate); static av_cold int query_formats(AVFilterContext *ctx) { ASetRateContext *sr = ctx->priv; - int sample_rates[] = { sr->sample_rate, -1 }; + int ret, sample_rates[] = { sr->sample_rate, -1 }; + + if ((ret = ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_AUDIO))) < 0) + return ret; + + if ((ret = ff_set_common_all_channel_counts(ctx)) < 0) + return ret; + + if ((ret = ff_formats_ref(ff_all_samplerates(), + &ctx->inputs[0]->outcfg.samplerates)) < 0) + return ret; return ff_formats_ref(ff_make_format_list(sample_rates), &ctx->outputs[0]->incfg.samplerates);