]> git.alsa-project.org Git - alsa-utils.git/commitdiff
speaker-test - Fix number of periods to play
authorTakashi Iwai <tiwai@suse.de>
Mon, 5 Nov 2007 11:40:35 +0000 (12:40 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 5 Nov 2007 11:40:35 +0000 (12:40 +0100)
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.

speaker-test/speaker-test.c

index 9a7bf3c68a9579d928818cbb0cc5e6bd0f2d26b5..b98d8e9ef74d2052b5c58ae75e8933ec5678ee31 100644 (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++) {
     if (test_type == TEST_PINK_NOISE)
       generate_pink_noise(frames, channel, period_size);