mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
Work around presumable ALSA bug that treats the dir argument to
snd_pcm_hw_params_set_periods_near() actually as > or < instead of >= and <=.
This commit is contained in:
parent
c7a77657ff
commit
f4c2f00f78
1 changed files with 11 additions and 4 deletions
|
|
@ -370,6 +370,12 @@ int pa_alsa_set_hw_params(
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
if (_periods > 0) {
|
if (_periods > 0) {
|
||||||
|
|
||||||
|
/* First we pass 0 as direction to get exactly what we asked
|
||||||
|
* for. That this is necessary is presumably a bug in ALSA */
|
||||||
|
|
||||||
|
dir = 0;
|
||||||
|
if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) {
|
||||||
dir = 1;
|
dir = 1;
|
||||||
if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) {
|
if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) {
|
||||||
dir = -1;
|
dir = -1;
|
||||||
|
|
@ -377,6 +383,7 @@ int pa_alsa_set_hw_params(
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (_period_size > 0)
|
if (_period_size > 0)
|
||||||
if ((ret = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size)) < 0)
|
if ((ret = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size)) < 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue