From 67868a886f38174b66b55317309da4cbfb444dcd Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 17 Feb 2006 20:49:21 +0000 Subject: [PATCH] Fix check of nonblock option Fix the check of nonblock option for all hw layer. Instead of passing in asound.conf, check the option in snd_pcm_hw_open() so that the nonblock option is referred in the case of "type hw ..." style definition, too. --- src/conf/alsa.conf | 4 ---- src/pcm/pcm_hw.c | 9 ++++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/conf/alsa.conf b/src/conf/alsa.conf index 25e06d23..ab5dcc1d 100644 --- a/src/conf/alsa.conf +++ b/src/conf/alsa.conf @@ -134,10 +134,6 @@ pcm.hw { card $CARD device $DEV subdevice $SUBDEV - nonblock { - @func refer - name defaults.pcm.nonblock - } } pcm.plughw { diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 9cd2e651..88dab15a 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -1291,11 +1291,18 @@ int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, long card = -1, device = 0, subdevice = -1; const char *str; int err, mmap_emulation = 0, sync_ptr_ioctl = 0; + snd_config_t *n; int nonblock = 1; /* non-block per default */ + /* look for defaults.pcm.nonblock definition */ + if (snd_config_search(root, "defaults.pcm.nonblock", &n) >= 0) { + err = snd_config_get_bool(n); + if (err >= 0) + nonblock = err; + } snd_config_for_each(i, next, conf) { - snd_config_t *n = snd_config_iterator_entry(i); const char *id; + n = snd_config_iterator_entry(i); if (snd_config_get_id(n, &id) < 0) continue; if (snd_pcm_conf_generic_id(id)) -- 2.47.1