History

spectrogram: fix default length regression

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.

Ulrich Klauer committed 14 years ago

Commit eb5b65e1 parent 68127912 files · +6 −1Browse files

Showing the changes to src/spectrogram.c (1 of 2 files). Show all

Unified · Split

src/spectrogram.c+1−1
@@ -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)

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