diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-05-13 10:39:41 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-05-13 10:58:48 +0200 |
commit | e076d8a9b3893886e7c7abd67cf715db40788a44 (patch) | |
tree | a7d46aa7305ec75d6e05041b5453215bd309766c | |
parent | ee6ef66d65730f426d25e7c942b7db4a3cb4bb1a (diff) | |
download | ffmpeg-e076d8a9b3893886e7c7abd67cf715db40788a44.tar.gz |
avfilter/af_asetrate: extend query_formats()
It left some formats not defined. Causing format negotiation
errors with ffplay.
Fixes #9248
-rw-r--r-- | libavfilter/af_asetrate.c | 12 |
1 files changed, 11 insertions, 1 deletions
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); |