If the input length is not known, make 8 seconds the default length of a spectrogram again. Previously, an empty spectrogram would be generated. This was a regression in 14.4.0 compared to 14.3.2, caused by changing the "unknown length" indicator from 0 to SOX_UNKNOWN_LEN; spectrogram still tested for 0.
Showing the changes to src/spectrogram.c (1 of 2 files). Show all
Unified · Split
| @@ -204,7 +204,7 @@ static int start(sox_effect_t * effp) · 203 unmodified lines | |||
| 204 | pixels_per_sec = min(5000, p->x_size / duration); | 204 | pixels_per_sec = min(5000, p->x_size / duration); |
| 205 | else if (!p->x_size && pixels_per_sec && duration) | 205 | else if (!p->x_size && pixels_per_sec && duration) |
| 206 | p->x_size = min(5000, (int)(pixels_per_sec * duration + .5)); | 206 | p->x_size = min(5000, (int)(pixels_per_sec * duration + .5)); |
| 207 | if (!duration && effp->in_signal.length) { | 207 | if (!duration && effp->in_signal.length != SOX_UNKNOWN_LEN) { |
| 208 | duration = effp->in_signal.length / (effp->in_signal.rate * effp->in_signal.channels); | 208 | duration = effp->in_signal.length / (effp->in_signal.rate * effp->in_signal.channels); |
| 209 | duration -= p->start_time; | 209 | duration -= p->start_time; |
| 210 | if (duration <= 0) | 210 | if (duration <= 0) |