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

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_adeclick.c+2−6
@@ -120,14 +120,10 @@ static int config_input(AVFilterLink *inlink) · 119 unmodified lines
120 int i;120 int i;
121 121
122 s->pts = AV_NOPTS_VALUE;122 s->pts = AV_NOPTS_VALUE;
123 s->window_size = inlink->sample_rate * s->w / 1000.;123 s->window_size = FFMAX(100, inlink->sample_rate * s->w / 1000.);
124 if (s->window_size < 100)
125 return AVERROR(EINVAL);
126 s->ar_order = FFMAX(s->window_size * s->ar / 100., 1);124 s->ar_order = FFMAX(s->window_size * s->ar / 100., 1);
127 s->nb_burst_samples = s->window_size * s->burst / 1000.;125 s->nb_burst_samples = s->window_size * s->burst / 1000.;
128 s->hop_size = s->window_size * (1. - (s->overlap / 100.));126 s->hop_size = FFMAX(1, s->window_size * (1. - (s->overlap / 100.)));
129 if (s->hop_size < 1)
130 return AVERROR(EINVAL);
131 127
132 s->window_func_lut = av_calloc(s->window_size, sizeof(*s->window_func_lut));128 s->window_func_lut = av_calloc(s->window_size, sizeof(*s->window_func_lut));
133 if (!s->window_func_lut)129 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