]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix restoration of PCM open mode
authorTakashi Iwai <tiwai@suse.de>
Mon, 20 Mar 2006 11:22:23 +0000 (11:22 +0000)
committerTakashi Iwai <tiwai@suse.de>
Mon, 20 Mar 2006 11:22:23 +0000 (11:22 +0000)
The original PCM open mode was lost by the change of default non-blocking
open.  The patch fix the restoration of the original open mode.

src/pcm/pcm_hw.c

index 4c1161fef47b4b5a308da0cbf3386040714f8d36..2c26d95b3a304b12a339a82abb8ac568effabd0f 100644 (file)
@@ -1429,9 +1429,11 @@ int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
                              mmap_emulation, sync_ptr_ioctl);
        if (err < 0)
                return err;
-       if (nonblock && ! (mode & SND_PCM_NONBLOCK))
+       if (nonblock && ! (mode & SND_PCM_NONBLOCK)) {
                /* revert to blocking mode for read/write access */
                snd_pcm_hw_nonblock(*pcmp, 0);
+               (*pcmp)->mode = mode;
+       }
 
        hw = (*pcmp)->private_data;
        if (format != SND_PCM_FORMAT_UNKNOWN)