mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 18:46:32 +01:00
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:
parent
14f7981d59
commit
9dd3e2801c
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue