mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-03-17 05:33:43 -04:00
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.
This commit is contained in:
parent
0757f70b1b
commit
67868a886f
2 changed files with 8 additions and 5 deletions
|
|
@ -134,10 +134,6 @@ pcm.hw {
|
||||||
card $CARD
|
card $CARD
|
||||||
device $DEV
|
device $DEV
|
||||||
subdevice $SUBDEV
|
subdevice $SUBDEV
|
||||||
nonblock {
|
|
||||||
@func refer
|
|
||||||
name defaults.pcm.nonblock
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pcm.plughw {
|
pcm.plughw {
|
||||||
|
|
|
||||||
|
|
@ -1291,11 +1291,18 @@ int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
|
||||||
long card = -1, device = 0, subdevice = -1;
|
long card = -1, device = 0, subdevice = -1;
|
||||||
const char *str;
|
const char *str;
|
||||||
int err, mmap_emulation = 0, sync_ptr_ioctl = 0;
|
int err, mmap_emulation = 0, sync_ptr_ioctl = 0;
|
||||||
|
snd_config_t *n;
|
||||||
int nonblock = 1; /* non-block per default */
|
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_for_each(i, next, conf) {
|
||||||
snd_config_t *n = snd_config_iterator_entry(i);
|
|
||||||
const char *id;
|
const char *id;
|
||||||
|
n = snd_config_iterator_entry(i);
|
||||||
if (snd_config_get_id(n, &id) < 0)
|
if (snd_config_get_id(n, &id) < 0)
|
||||||
continue;
|
continue;
|
||||||
if (snd_pcm_conf_generic_id(id))
|
if (snd_pcm_conf_generic_id(id))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue