diff options
author | 2015-12-20 11:29:29 +0000 | |
---|---|---|
committer | 2015-12-20 11:29:29 +0000 | |
commit | bde5d16205d7fce9aa9d9c4a24abc5f43058c82b (patch) | |
tree | dc6078f73552b21d54ec6e782f831d1877054c98 | |
parent | Do not delay video(4) attachment if the device does not need to load (diff) | |
download | wireguard-openbsd-bde5d16205d7fce9aa9d9c4a24abc5f43058c82b.tar.xz wireguard-openbsd-bde5d16205d7fce9aa9d9c4a24abc5f43058c82b.zip |
Expose internal functions necessary to open audio devices and midi
ports using existing file descriptors.
-rw-r--r-- | include/sndio.h | 7 | ||||
-rw-r--r-- | lib/libsndio/mio_rmidi.c | 12 | ||||
-rw-r--r-- | lib/libsndio/shlib_version | 2 | ||||
-rw-r--r-- | lib/libsndio/sio_sun.c | 12 |
4 files changed, 25 insertions, 8 deletions
diff --git a/include/sndio.h b/include/sndio.h index 7e161bef455..dcb9ddfbb19 100644 --- a/include/sndio.h +++ b/include/sndio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sndio.h,v 1.8 2012/08/22 08:56:46 espie Exp $ */ +/* $OpenBSD: sndio.h,v 1.9 2015/12/20 11:29:29 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -144,6 +144,11 @@ int mio_pollfd(struct mio_hdl *, struct pollfd *, int); int mio_revents(struct mio_hdl *, struct pollfd *); int mio_eof(struct mio_hdl *); +int mio_rmidi_getfd(const char *, unsigned int, int); +struct mio_hdl *mio_rmidi_fdopen(int, unsigned int, int); +int sio_sun_getfd(const char *, unsigned int, int); +struct sio_hdl *sio_sun_fdopen(int, unsigned int, int); + #ifdef __cplusplus } #endif diff --git a/lib/libsndio/mio_rmidi.c b/lib/libsndio/mio_rmidi.c index a00ed7f9f63..7034873b37c 100644 --- a/lib/libsndio/mio_rmidi.c +++ b/lib/libsndio/mio_rmidi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mio_rmidi.c,v 1.22 2015/11/30 02:41:45 ratchov Exp $ */ +/* $OpenBSD: mio_rmidi.c,v 1.23 2015/12/20 11:29:29 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -56,7 +56,7 @@ static struct mio_ops mio_rmidi_ops = { mio_rmidi_revents }; -static int +int mio_rmidi_getfd(const char *str, unsigned int mode, int nbio) { const char *p; @@ -64,6 +64,9 @@ mio_rmidi_getfd(const char *str, unsigned int mode, int nbio) unsigned int devnum; int fd, flags; +#ifdef DEBUG + _sndio_debug_init(); +#endif p = _sndio_parsetype(str, "rmidi"); if (p == NULL) { DPRINTF("mio_rmidi_getfd: %s: \"rsnd\" expected\n", str); @@ -96,11 +99,14 @@ mio_rmidi_getfd(const char *str, unsigned int mode, int nbio) return fd; } -static struct mio_hdl * +struct mio_hdl * mio_rmidi_fdopen(int fd, unsigned int mode, int nbio) { struct mio_rmidi_hdl *hdl; +#ifdef DEBUG + _sndio_debug_init(); +#endif hdl = malloc(sizeof(struct mio_rmidi_hdl)); if (hdl == NULL) return NULL; diff --git a/lib/libsndio/shlib_version b/lib/libsndio/shlib_version index 9c1551636c5..1394f4e4035 100644 --- a/lib/libsndio/shlib_version +++ b/lib/libsndio/shlib_version @@ -1,2 +1,2 @@ major=6 -minor=0 +minor=1 diff --git a/lib/libsndio/sio_sun.c b/lib/libsndio/sio_sun.c index fd1be901fe3..51928f868a0 100644 --- a/lib/libsndio/sio_sun.c +++ b/lib/libsndio/sio_sun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sio_sun.c,v 1.23 2015/11/22 12:10:26 ratchov Exp $ */ +/* $OpenBSD: sio_sun.c,v 1.24 2015/12/20 11:29:29 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -328,7 +328,7 @@ sio_sun_getcap(struct sio_hdl *sh, struct sio_cap *cap) #undef NRATES } -static int +int sio_sun_getfd(const char *str, unsigned int mode, int nbio) { const char *p; @@ -336,6 +336,9 @@ sio_sun_getfd(const char *str, unsigned int mode, int nbio) unsigned int devnum; int fd, flags; +#ifdef DEBUG + _sndio_debug_init(); +#endif p = _sndio_parsetype(str, "rsnd"); if (p == NULL) { DPRINTF("sio_sun_getfd: %s: \"rsnd\" expected\n", str); @@ -368,13 +371,16 @@ sio_sun_getfd(const char *str, unsigned int mode, int nbio) return fd; } -static struct sio_hdl * +struct sio_hdl * sio_sun_fdopen(int fd, unsigned int mode, int nbio) { struct audio_info aui; struct sio_sun_hdl *hdl; struct sio_par par; +#ifdef DEBUG + _sndio_debug_init(); +#endif hdl = malloc(sizeof(struct sio_sun_hdl)); if (hdl == NULL) return NULL; |