History

avfilter/af_adeclick: stop returning EINVAL error

Instead clip relevant parameters.

Paul B Mahol committed 3 years ago

Commit 9c694801 parent 3e04f531 file · +2 −6Browse files

Unified · Split

libavfilter/af_adeclick.c+2−6
@@ -120,14 +120,10 @@ static int config_input(AVFilterLink *inlink) · 119 unmodified lines
120120 int i;
121121
122122 s->pts = AV_NOPTS_VALUE;
123− s->window_size = inlink->sample_rate * s->w / 1000.;
124− if (s->window_size < 100)
125− return AVERROR(EINVAL);
123+ s->window_size = FFMAX(100, inlink->sample_rate * s->w / 1000.);
126124 s->ar_order = FFMAX(s->window_size * s->ar / 100., 1);
127125 s->nb_burst_samples = s->window_size * s->burst / 1000.;
128− s->hop_size = s->window_size * (1. - (s->overlap / 100.));
129− if (s->hop_size < 1)
130− return AVERROR(EINVAL);
126+ s->hop_size = FFMAX(1, s->window_size * (1. - (s->overlap / 100.)));
131127
132128 s->window_func_lut = av_calloc(s->window_size, sizeof(*s->window_func_lut));
133129 if (!s->window_func_lut)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t