From 0531b15bba491fabaa6e2455c88ff39dff8b86f1 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 9 Oct 2024 22:28:42 +0200 Subject: [PATCH] avfilter/aiireq_template: fix unstable output in some cases --- libavfilter/aiireq_template.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavfilter/aiireq_template.c b/libavfilter/aiireq_template.c index 94af3bba33..1066e95cd4 100644 --- a/libavfilter/aiireq_template.c +++ b/libavfilter/aiireq_template.c @@ -173,7 +173,10 @@ static int fn(init_filter)(AVFilterContext *ctx) dB = s->gain_opt[gn] - s->gain_opt[gn-1]; } - design_freq = av_clipd(design_freq, 0.0, fs-0.1); + if (design_freq >= fs * 0.5) { + eqs->nb_sections = 0; + continue; + } eqs->nb_sections = fn(get_svf)(fs, design_freq, eqs->nb_sections * 2, dB, eqs); }