1
0
mirror of http://www.pogo.org.uk/~mark/trx.git synced 2024-11-21 18:05:06 +01:00

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.
This commit is contained in:
Mark Hills 2014-03-21 18:43:05 +00:00
parent b7ac96036d
commit 591a498725

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);