mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 17:55:43 +01:00
fix default buffer time setting when maximum buffer time is less than 250 ms
This commit is contained in:
parent
25141facf0
commit
4b26b779a1
1 changed files with 7 additions and 2 deletions
|
@ -852,8 +852,13 @@ static void set_params(void)
|
|||
}
|
||||
}
|
||||
rate = hwparams.rate;
|
||||
if (buffer_time == 0 && buffer_frames == 0)
|
||||
buffer_time = 500000;
|
||||
if (buffer_time == 0 && buffer_frames == 0) {
|
||||
err = snd_pcm_hw_params_get_buffer_time_max(params,
|
||||
&buffer_time, 0);
|
||||
assert(err >= 0);
|
||||
if (buffer_time > 500000)
|
||||
buffer_time = 500000;
|
||||
}
|
||||
if (period_time == 0 && period_frames == 0) {
|
||||
if (buffer_time > 0)
|
||||
period_time = buffer_time / 4;
|
||||
|
|
Loading…
Reference in a new issue