mirror of https://github.com/ericonr/sndio.git
Allow "snd/default" style syntax
This commit is contained in:
parent
d2057194b1
commit
ddf18ab3e1
|
@ -45,9 +45,9 @@ sioctl_open(const char *str, unsigned int mode, int nbio)
|
||||||
if (hdl != NULL)
|
if (hdl != NULL)
|
||||||
return hdl;
|
return hdl;
|
||||||
#if defined(USE_SUN_MIXER)
|
#if defined(USE_SUN_MIXER)
|
||||||
return _sioctl_sun_open("rsnd/0", mode, nbio);
|
return _sioctl_sun_open("rsnd/default", mode, nbio);
|
||||||
#elif defined(USE_ALSA_MIXER)
|
#elif defined(USE_ALSA_MIXER)
|
||||||
return _sioctl_alsa_open("rsnd/0", mode, nbio);
|
return _sioctl_alsa_open("rsnd/default", mode, nbio);
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -294,10 +294,14 @@ sioctl_sun_getfd(const char *str, unsigned int mode, int nbio)
|
||||||
DPRINTF("sioctl_sun_getfd: %s: '/' expected\n", str);
|
DPRINTF("sioctl_sun_getfd: %s: '/' expected\n", str);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
p = _sndio_parsenum(p, &devnum, 255);
|
if (strcmp(p, "default") == 0) {
|
||||||
if (p == NULL || *p != '\0') {
|
devnum = 0;
|
||||||
DPRINTF("sioctl_sun_getfd: %s: number expected after '/'\n", str);
|
} else {
|
||||||
return -1;
|
p = _sndio_parsenum(p, &devnum, 255);
|
||||||
|
if (p == NULL || *p != '\0') {
|
||||||
|
DPRINTF("sioctl_sun_getfd: %s: number expected after '/'\n", str);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
snprintf(path, sizeof(path), DEVPATH_PREFIX "%u", devnum);
|
snprintf(path, sizeof(path), DEVPATH_PREFIX "%u", devnum);
|
||||||
if (mode == (SIOCTL_READ | SIOCTL_WRITE))
|
if (mode == (SIOCTL_READ | SIOCTL_WRITE))
|
||||||
|
|
Loading…
Reference in New Issue