Be more specific when setting buffer time

We don't want the max buffer time, but we want the nearest buffer
time that is below the value provided by the user.
master
Mark Hills 2014-03-21 18:43:05 +00:00
parent b7ac96036d
commit 591a498725
1 changed files with 3 additions and 3 deletions

View File

@ -62,9 +62,9 @@ int set_alsa_hw(snd_pcm_t *pcm,
r = snd_pcm_hw_params_set_channels(pcm, hw, channels);
CHK("snd_pcm_hw_params_set_channels", r);
dir = 0;
r = snd_pcm_hw_params_set_buffer_time_max(pcm, hw, &buffer, &dir);
CHK("snd_pcm_hw_params_set_buffer_time_max", r);
dir = -1;
r = snd_pcm_hw_params_set_buffer_time_near(pcm, hw, &buffer, &dir);
CHK("snd_pcm_hw_params_set_buffer_time_near", r);
r = snd_pcm_hw_params(pcm, hw);
CHK("hw_params", r);