mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 17:25:42 +01:00
Added limits for start_threshold
This commit is contained in:
parent
10eb237435
commit
6a76ce51c0
1 changed files with 4 additions and 0 deletions
|
@ -791,6 +791,10 @@ static void set_params(void)
|
|||
start_threshold = buffer_size + (double) rate * start_delay / 1000000;
|
||||
else
|
||||
start_threshold = (double) rate * start_delay / 1000000;
|
||||
if (start_threshold < 1)
|
||||
start_threshold = 1;
|
||||
if (start_threshold > buffer_size)
|
||||
start_threshold = buffer_size;
|
||||
err = snd_pcm_sw_params_set_start_threshold(handle, swparams, start_threshold);
|
||||
assert(err >= 0);
|
||||
if (stop_delay <= 0)
|
||||
|
|
Loading…
Reference in a new issue