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.
This commit is contained in:
Takashi Iwai 2006-03-20 11:22:23 +00:00
parent eecfed7569
commit 38a3aa096c

View 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)