lavfi/af_join: convert to query_func2()

Also, drop a redundant call that also happens implicitly in generic code.
release/7.1
Anton Khirnov 4 months ago
parent fdc6e31725
commit 48d9a4d7ca
  1. 15
      libavfilter/af_join.c

@ -201,24 +201,25 @@ static av_cold void join_uninit(AVFilterContext *ctx)
av_freep(&s->input_frames); av_freep(&s->input_frames);
} }
static int join_query_formats(AVFilterContext *ctx) static int join_query_formats(const AVFilterContext *ctx,
AVFilterFormatsConfig **cfg_in,
AVFilterFormatsConfig **cfg_out)
{ {
JoinContext *s = ctx->priv; const JoinContext *s = ctx->priv;
AVFilterChannelLayouts *layouts = NULL; AVFilterChannelLayouts *layouts = NULL;
int i, ret; int i, ret;
if ((ret = ff_add_channel_layout(&layouts, &s->ch_layout)) < 0 || if ((ret = ff_add_channel_layout(&layouts, &s->ch_layout)) < 0 ||
(ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0) (ret = ff_channel_layouts_ref(layouts, &cfg_out[0]->channel_layouts)) < 0)
return ret; return ret;
for (i = 0; i < ctx->nb_inputs; i++) { for (i = 0; i < ctx->nb_inputs; i++) {
layouts = ff_all_channel_layouts(); layouts = ff_all_channel_layouts();
if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->outcfg.channel_layouts)) < 0) if ((ret = ff_channel_layouts_ref(layouts, &cfg_in[0]->channel_layouts)) < 0)
return ret; return ret;
} }
if ((ret = ff_set_common_formats(ctx, ff_planar_sample_fmts())) < 0 || if ((ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_planar_sample_fmts())) < 0)
(ret = ff_set_common_all_samplerates(ctx)) < 0)
return ret; return ret;
return 0; return 0;
@ -605,6 +606,6 @@ const AVFilter ff_af_join = {
.activate = activate, .activate = activate,
.inputs = NULL, .inputs = NULL,
FILTER_OUTPUTS(avfilter_af_join_outputs), FILTER_OUTPUTS(avfilter_af_join_outputs),
FILTER_QUERY_FUNC(join_query_formats), FILTER_QUERY_FUNC2(join_query_formats),
.flags = AVFILTER_FLAG_DYNAMIC_INPUTS, .flags = AVFILTER_FLAG_DYNAMIC_INPUTS,
}; };

Loading…
Cancel
Save