Instead clip relevant parameters.
Unified · Split
| @@ -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) |