]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix check of nonblock option
authorTakashi Iwai <tiwai@suse.de>
Fri, 17 Feb 2006 20:49:21 +0000 (20:49 +0000)
committerTakashi Iwai <tiwai@suse.de>
Fri, 17 Feb 2006 20:49:21 +0000 (20:49 +0000)
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
src/pcm/pcm_hw.c

index 25e06d2353a060dd13d3444d619fdd9005b724bd..ab5dcc1d62e8f60c348ba085275994efae85e397 100644 (file)
@@ -134,10 +134,6 @@ pcm.hw {
        card $CARD
        device $DEV
        subdevice $SUBDEV
-       nonblock {
-               @func refer
-               name defaults.pcm.nonblock
-       }
 }
 
 pcm.plughw {
index 9cd2e6512c3b26fd65f6bfa5e4adaa916b4bec52..88dab15af90633499332584e166dba7078eabb06 100644 (file)
@@ -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))