summaryrefslogtreecommitdiffstats
path: root/lib/libsndio/sio_sun.c
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2015-12-20 11:29:29 +0000
committerratchov <ratchov@openbsd.org>2015-12-20 11:29:29 +0000
commitbde5d16205d7fce9aa9d9c4a24abc5f43058c82b (patch)
treedc6078f73552b21d54ec6e782f831d1877054c98 /lib/libsndio/sio_sun.c
parentDo not delay video(4) attachment if the device does not need to load (diff)
downloadwireguard-openbsd-bde5d16205d7fce9aa9d9c4a24abc5f43058c82b.tar.xz
wireguard-openbsd-bde5d16205d7fce9aa9d9c4a24abc5f43058c82b.zip
Expose internal functions necessary to open audio devices and midi
ports using existing file descriptors.
Diffstat (limited to '')
-rw-r--r--lib/libsndio/sio_sun.c12
1 files changed, 9 insertions, 3 deletions
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;