[FFmpeg-cvslog] lavfi/af_anlms: convert to query_func2()
Anton Khirnov
git at videolan.org
Thu Sep 5 11:09:04 EEST 2024
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Aug 30 21:56:02 2024 +0200| [6f2adb796705f54826ad706c4d539a5f95b21735] | committer: Anton Khirnov
lavfi/af_anlms: 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=6f2adb796705f54826ad706c4d539a5f95b21735
---
libavfilter/af_anlms.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/libavfilter/af_anlms.c b/libavfilter/af_anlms.c
index 1764b01072..4e83a0501d 100644
--- a/libavfilter/af_anlms.c
+++ b/libavfilter/af_anlms.c
@@ -87,9 +87,11 @@ static const AVOption anlms_options[] = {
AVFILTER_DEFINE_CLASS_EXT(anlms, "anlm(f|s)", anlms_options);
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
{
- AudioNLMSContext *s = ctx->priv;
+ const AudioNLMSContext *s = ctx->priv;
static const enum AVSampleFormat sample_fmts[3][3] = {
{ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE },
{ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE },
@@ -97,13 +99,11 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- if ((ret = ff_set_common_all_channel_counts(ctx)) < 0)
- return ret;
-
- if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts[s->precision])) < 0)
+ if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out,
+ sample_fmts[s->precision])) < 0)
return ret;
- return ff_set_common_all_samplerates(ctx);
+ return 0;
}
static int activate(AVFilterContext *ctx)
@@ -277,7 +277,7 @@ const AVFilter ff_af_anlmf = {
.activate = activate,
FILTER_INPUTS(inputs),
FILTER_OUTPUTS(outputs),
- FILTER_QUERY_FUNC(query_formats),
+ FILTER_QUERY_FUNC2(query_formats),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
AVFILTER_FLAG_SLICE_THREADS,
.process_command = ff_filter_process_command,
More information about the ffmpeg-cvslog
mailing list