mirror of
https://github.com/alsa-project/alsa-utils
synced 2025-01-03 09:29:50 +01:00
Fix the default buffer size calculation in speaker-test
Fixed the default buffer size calculation in speaker-test. The size should be aligned to nperiods.
This commit is contained in:
parent
10e3f81ef7
commit
7af6e01ace
1 changed files with 2 additions and 0 deletions
|
@ -342,6 +342,8 @@ static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params, snd_pcm_
|
|||
}
|
||||
if (! buffer_time && ! period_time) {
|
||||
buffer_size = buffer_size_max;
|
||||
if (! period_time)
|
||||
buffer_size = (buffer_size / nperiods) * nperiods;
|
||||
printf(_("Using max buffer size %lu\n"), buffer_size);
|
||||
err = snd_pcm_hw_params_set_buffer_size_near(handle, params, &buffer_size);
|
||||
if (err < 0) {
|
||||
|
|
Loading…
Reference in a new issue