lavfi/af_aiir: convert to query_func2()

Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
release/7.1
Anton Khirnov 4 months ago
parent f143723095
commit 6e4affc407
  1. 20
      libavfilter/af_aiir.c

@ -78,9 +78,11 @@ typedef struct AudioIIRContext {
int (*iir_channel)(AVFilterContext *ctx, void *arg, int ch, int nb_jobs);
} AudioIIRContext;
static int query_formats(AVFilterContext *ctx)
static int query_formats(const AVFilterContext *ctx,
AVFilterFormatsConfig **cfg_in,
AVFilterFormatsConfig **cfg_out)
{
AudioIIRContext *s = ctx->priv;
const AudioIIRContext *s = ctx->priv;
AVFilterFormats *formats;
enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_DBLP,
@ -93,23 +95,17 @@ static int query_formats(AVFilterContext *ctx)
int ret;
if (s->response) {
AVFilterLink *videolink = ctx->outputs[1];
formats = ff_make_format_list(pix_fmts);
if ((ret = ff_formats_ref(formats, &videolink->incfg.formats)) < 0)
if ((ret = ff_formats_ref(formats, &cfg_out[1]->formats)) < 0)
return ret;
}
ret = ff_set_common_all_channel_counts(ctx);
if (ret < 0)
return ret;
sample_fmts[0] = s->sample_format;
ret = ff_set_common_formats_from_list(ctx, sample_fmts);
ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts);
if (ret < 0)
return ret;
return ff_set_common_all_samplerates(ctx);
return 0;
}
#define IIR_CH(name, type, min, max, need_clipping) \
@ -1572,7 +1568,7 @@ const AVFilter ff_af_aiir = {
.init = init,
.uninit = uninit,
FILTER_INPUTS(inputs),
FILTER_QUERY_FUNC(query_formats),
FILTER_QUERY_FUNC2(query_formats),
.flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS |
AVFILTER_FLAG_SLICE_THREADS,
};

Loading…
Cancel
Save