ffmpeg | branch: master | Anton Khirnov <an...@khirnov.net> | Wed Sep 4 14:43:33 2024 +0200| [bfb139bb8d100f231b38142ec8b5f1e3ea3a2768] | committer: Anton Khirnov
lavfi/af_ladspa: convert to query_func2() > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bfb139bb8d100f231b38142ec8b5f1e3ea3a2768 --- libavfilter/af_ladspa.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/libavfilter/af_ladspa.c b/libavfilter/af_ladspa.c index 2f8c92cd14..35ff90b1a8 100644 --- a/libavfilter/af_ladspa.c +++ b/libavfilter/af_ladspa.c @@ -694,31 +694,29 @@ static av_cold int init(AVFilterContext *ctx) return 0; } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - LADSPAContext *s = ctx->priv; + const LADSPAContext *s = ctx->priv; AVFilterChannelLayouts *layouts; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; - int ret = ff_set_common_formats_from_list(ctx, sample_fmts); + int ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts); if (ret < 0) return ret; - if (s->nb_inputs) { - ret = ff_set_common_all_samplerates(ctx); - if (ret < 0) - return ret; - } else { + if (!s->nb_inputs) { int sample_rates[] = { s->sample_rate, -1 }; - ret = ff_set_common_samplerates_from_list(ctx, sample_rates); + ret = ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates); if (ret < 0) return ret; } if (s->nb_inputs == 1 && s->nb_outputs == 1) { // We will instantiate multiple LADSPA_Handle, one over each channel - ret = ff_set_common_all_channel_counts(ctx); + ret = ff_set_common_all_channel_counts2(ctx, cfg_in, cfg_out); if (ret < 0) return ret; } else if (s->nb_inputs == 2 && s->nb_outputs == 2) { @@ -726,26 +724,23 @@ static int query_formats(AVFilterContext *ctx) ret = ff_add_channel_layout(&layouts, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO); if (ret < 0) return ret; - ret = ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts2(ctx, cfg_in, cfg_out, layouts); if (ret < 0) return ret; } else { - AVFilterLink *outlink = ctx->outputs[0]; - if (s->nb_inputs >= 1) { - AVFilterLink *inlink = ctx->inputs[0]; AVChannelLayout inlayout = FF_COUNT2LAYOUT(s->nb_inputs); layouts = NULL; ret = ff_add_channel_layout(&layouts, &inlayout); if (ret < 0) return ret; - ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts); + ret = ff_channel_layouts_ref(layouts, &cfg_in[0]->channel_layouts); if (ret < 0) return ret; if (!s->nb_outputs) { - ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts); + ret = ff_channel_layouts_ref(layouts, &cfg_out[0]->channel_layouts); if (ret < 0) return ret; } @@ -758,7 +753,7 @@ static int query_formats(AVFilterContext *ctx) ret = ff_add_channel_layout(&layouts, &outlayout); if (ret < 0) return ret; - ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts); + ret = ff_channel_layouts_ref(layouts, &cfg_out[0]->channel_layouts); if (ret < 0) return ret; } @@ -825,6 +820,6 @@ const AVFilter ff_af_ladspa = { .process_command = process_command, .inputs = 0, FILTER_OUTPUTS(ladspa_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .flags = AVFILTER_FLAG_DYNAMIC_INPUTS, }; _______________________________________________ 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".