From: Takashi Iwai Date: Mon, 20 Mar 2006 11:22:23 +0000 (+0000) Subject: Fix restoration of PCM open mode X-Git-Tag: v1.0.11rc4~9 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=38a3aa096c173ccd2020794c0ba6e68d32f0b337;p=alsa-lib.git Fix restoration of PCM open mode 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. --- diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 4c1161fe..2c26d95b 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -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)