From 9dd3e2801c8f774421a0f386ef540b7ed75952ca Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 5 Nov 2007 12:40:35 +0100 Subject: [PATCH] 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. --- speaker-test/speaker-test.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.47.1