From: Takashi Iwai Date: Mon, 5 Nov 2007 11:40:35 +0000 (+0100) Subject: speaker-test - Fix number of periods to play X-Git-Tag: v1.0.16rc1~11 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=9dd3e2801c8f774421a0f386ef540b7ed75952ca;p=alsa-utils.git 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. --- diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c index 9a7bf3c..b98d8e9 100644 --- a/speaker-test/speaker-test.c +++ b/speaker-test/speaker-test.c @@ -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++) { if (test_type == TEST_PINK_NOISE) generate_pink_noise(frames, channel, period_size);