diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-09-04 14:43:33 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-09-09 17:26:17 +0200 |
commit | 48d9a4d7ca759523c824d570bce26af5b9e33d35 (patch) | |
tree | bb8b11d36a02c04c115827c3b04278daf041d992 /libavfilter | |
parent | fdc6e31725768bddcb2e261cc8a91080b1f7dd43 (diff) | |
download | ffmpeg-48d9a4d7ca759523c824d570bce26af5b9e33d35.tar.gz |
lavfi/af_join: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_join.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c index e1d8b0e00c..db0320aa70 100644 --- a/libavfilter/af_join.c +++ b/libavfilter/af_join.c @@ -201,24 +201,25 @@ static av_cold void join_uninit(AVFilterContext *ctx) 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; int i, ret; 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; for (i = 0; i < ctx->nb_inputs; i++) { 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; } - if ((ret = ff_set_common_formats(ctx, ff_planar_sample_fmts())) < 0 || - (ret = ff_set_common_all_samplerates(ctx)) < 0) + if ((ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_planar_sample_fmts())) < 0) return ret; return 0; @@ -605,6 +606,6 @@ const AVFilter ff_af_join = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(avfilter_af_join_outputs), - FILTER_QUERY_FUNC(join_query_formats), + FILTER_QUERY_FUNC2(join_query_formats), .flags = AVFILTER_FLAG_DYNAMIC_INPUTS, }; |