Instead clip relevant parameters.
Unified · Split
| @@ -120,14 +120,10 @@ static int config_input(AVFilterLink *inlink) · 119 unmodified lines | ||
| 120 | 120 | int i; |
| 121 | 121 | |
| 122 | 122 | 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.); | |
| 126 | 124 | s->ar_order = FFMAX(s->window_size * s->ar / 100., 1); |
| 127 | 125 | 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.))); | |
| 131 | 127 | |
| 132 | 128 | s->window_func_lut = av_calloc(s->window_size, sizeof(*s->window_func_lut)); |
| 133 | 129 | if (!s->window_func_lut) |