speaker-test - Fix number of periods to play

The number of periods to play in pink and sine modes could be calculated
as zero, which results in just silence.  Make the minimal value 1.
This commit is contained in:
Takashi Iwai 2007-11-05 12:40:35 +01:00
parent 14f7981d59
commit 9dd3e2801c

View file

@ -684,6 +684,9 @@ static int write_loop(snd_pcm_t *handle, int channel, int periods, uint8_t *fram
} }
if (periods <= 0)
periods = 1;
for(n = 0; n < periods; n++) { for(n = 0; n < periods; n++) {
if (test_type == TEST_PINK_NOISE) if (test_type == TEST_PINK_NOISE)
generate_pink_noise(frames, channel, period_size); generate_pink_noise(frames, channel, period_size);