]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm_mmap_emul: Fix invalid check
authorTakashi Iwai <tiwai@suse.de>
Fri, 6 Jun 2008 15:05:56 +0000 (17:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 6 Jun 2008 15:05:56 +0000 (17:05 +0200)
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>
src/pcm/pcm_mmap_emul.c

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