aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-08-12 11:27:32 +0200
committerPaul B Mahol <onemda@gmail.com>2023-08-12 11:27:32 +0200
commit9c694804fd360bb012e3ec6f295b2bb8e61e6ae9 (patch)
tree2ea9c6d151837b9a625690387b9a5378082c48a2
parent3e04f5357100346dd42c979d3ebcbc69d3c8d2a8 (diff)
downloadffmpeg-9c694804fd360bb012e3ec6f295b2bb8e61e6ae9.tar.gz
avfilter/af_adeclick: stop returning EINVAL error
Instead clip relevant parameters.
-rw-r--r--libavfilter/af_adeclick.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavfilter/af_adeclick.c b/libavfilter/af_adeclick.c
index fad6bc5913..4bbe36bdd5 100644
--- a/libavfilter/af_adeclick.c
+++ b/libavfilter/af_adeclick.c
@@ -120,14 +120,10 @@ static int config_input(AVFilterLink *inlink)
int i;
s->pts = AV_NOPTS_VALUE;
- s->window_size = inlink->sample_rate * s->w / 1000.;
- if (s->window_size < 100)
- return AVERROR(EINVAL);
+ s->window_size = FFMAX(100, inlink->sample_rate * s->w / 1000.);
s->ar_order = FFMAX(s->window_size * s->ar / 100., 1);
s->nb_burst_samples = s->window_size * s->burst / 1000.;
- s->hop_size = s->window_size * (1. - (s->overlap / 100.));
- if (s->hop_size < 1)
- return AVERROR(EINVAL);
+ s->hop_size = FFMAX(1, s->window_size * (1. - (s->overlap / 100.)));
s->window_func_lut = av_calloc(s->window_size, sizeof(*s->window_func_lut));
if (!s->window_func_lut)