avfilter/af_asetrate: extend query_formats()

It left some formats not defined. Causing format negotiation
errors with ffplay.

Fixes #9248
pull/389/head
Paul B Mahol 2 years ago
parent ee6ef66d65
commit e076d8a9b3
  1. 12
      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);

Loading…
Cancel
Save