ffmpeg | branch: master | Anton Khirnov <an...@khirnov.net> | Thu Sep 5 12:03:23 2024 +0200| [691e0a1082474815af4b31dbf8f7f8e19193316d] | committer: Anton Khirnov
lavfi/af_pan: convert to query_func2() Also, drop redundant calls that also happen implicitly in generic code. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=691e0a1082474815af4b31dbf8f7f8e19193316d --- libavfilter/af_pan.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c index f2f6daa658..0d20b0307b 100644 --- a/libavfilter/af_pan.c +++ b/libavfilter/af_pan.c @@ -243,31 +243,24 @@ fail: return ret; } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { const PanContext *pan = ctx->priv; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; AVFilterChannelLayouts *layouts; int ret; - /* libswr supports any sample and packing formats */ - if ((ret = ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_AUDIO))) < 0) - return ret; - - if ((ret = ff_set_common_all_samplerates(ctx)) < 0) - return ret; - // inlink supports any channel layout layouts = ff_all_channel_counts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) + if ((ret = ff_channel_layouts_ref(layouts, &cfg_in[0]->channel_layouts)) < 0) return ret; // outlink supports only requested output channel layout layouts = NULL; if ((ret = ff_add_channel_layout(&layouts, &pan->out_channel_layout)) < 0) return ret; - return ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts); + return ff_channel_layouts_ref(layouts, &cfg_out[0]->channel_layouts); } static int config_props(AVFilterLink *link) @@ -432,5 +425,5 @@ const AVFilter ff_af_pan = { .uninit = uninit, FILTER_INPUTS(pan_inputs), FILTER_OUTPUTS(ff_audio_default_filterpad), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".