mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
fix alsa mmap initialization bogosity, discovered by Jyri Sarha
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1950 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
dc987e9df8
commit
0d84e4ccb9
1 changed files with 8 additions and 3 deletions
|
|
@ -298,14 +298,19 @@ int pa_alsa_set_hw_params(snd_pcm_t *pcm_handle, pa_sample_spec *ss, uint32_t *p
|
|||
goto finish;
|
||||
|
||||
if (use_mmap && *use_mmap) {
|
||||
if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0)
|
||||
if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0) {
|
||||
|
||||
/* mmap() didn't work, fall back to interleaved */
|
||||
|
||||
if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0)
|
||||
goto finish;
|
||||
|
||||
if (use_mmap)
|
||||
*use_mmap = 0;
|
||||
}
|
||||
|
||||
} else if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0)
|
||||
goto finish;
|
||||
else if (*use_mmap)
|
||||
*use_mmap = 0;
|
||||
|
||||
if ((ret = set_format(pcm_handle, hwparams, &f)) < 0)
|
||||
goto finish;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue