[FFmpeg-cvslog] lavfi/af_join: convert to query_func2()
Anton Khirnov
git at videolan.org
Mon Sep 9 18:27:07 EEST 2024
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Sep 4 14:43:33 2024 +0200| [48d9a4d7ca759523c824d570bce26af5b9e33d35] | committer: Anton Khirnov
lavfi/af_join: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48d9a4d7ca759523c824d570bce26af5b9e33d35
---
libavfilter/af_join.c | 15 ++++++++-------
1 file 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,
};
More information about the ffmpeg-cvslog
mailing list