pcm_mmap_emul: Fix invalid check

The check in snd_pcm_mmap_emul_refine() is bogus and buggy.

Since the changed access type is took back at snd_pcm_mmap_emul_refine
again, it has to check the availability of mmap at each time.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2008-06-06 17:05:56 +02:00
parent b6af5e1822
commit 2db108cc72

View file

@ -62,11 +62,9 @@ static int snd_pcm_mmap_emul_hw_refine(snd_pcm_t *pcm,
snd_mask_none(&mask); snd_mask_none(&mask);
err = snd_pcm_hw_refine(map->gen.slave, params); err = snd_pcm_hw_refine(map->gen.slave, params);
if (err < 0) { if (err < 0) {
/* try to use RW_* */
snd_pcm_hw_params_t new = *params; snd_pcm_hw_params_t new = *params;
if (!(params->rmask & (1<<SND_PCM_HW_PARAM_ACCESS))) /* try to use RW_* */
return err;
if (snd_pcm_access_mask_test(&oldmask, if (snd_pcm_access_mask_test(&oldmask,
SND_PCM_ACCESS_MMAP_INTERLEAVED) && SND_PCM_ACCESS_MMAP_INTERLEAVED) &&
!snd_pcm_access_mask_test(&oldmask, !snd_pcm_access_mask_test(&oldmask,