summaryrefslogtreecommitdiff
path: root/lib/libsndio/sio_aucat.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2011-11-15 08:05:23 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2011-11-15 08:05:23 +0000
commit1d03551d3bdde57b6b26304c15d01e24fa830fd2 (patch)
treef427bbcfc086b18d7aae9e6201af95c20d4779ac /lib/libsndio/sio_aucat.c
parent231448b73ea84fb6b44a1e2fad2383a7ae09872d (diff)
Add a "device number" component in sndio(7) device names, allowing a
single aucat instance to handle all audio and MIDI services. Since this partially breaks compatibility, this is a opportunitiy to fix few other design mistakes (eg ':' being used by inet6, type name vs api name confusion, etc..). This leads to the following names: type[@hostname][,unit]/devnum[.option] The device number is the minor device number for direct hardware access (ie the 'N' in /dev/audioN). For aucat, this is the occurence number of the -f (or -M) option. There's a compatibility hook to keep old names working if only one aucat server is running.
Diffstat (limited to 'lib/libsndio/sio_aucat.c')
-rw-r--r--lib/libsndio/sio_aucat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libsndio/sio_aucat.c b/lib/libsndio/sio_aucat.c
index 2fbdea23492..2a97b878930 100644
--- a/lib/libsndio/sio_aucat.c
+++ b/lib/libsndio/sio_aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sio_aucat.c,v 1.8 2011/10/17 21:09:11 ratchov Exp $ */
+/* $OpenBSD: sio_aucat.c,v 1.9 2011/11/15 08:05:22 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -109,7 +109,7 @@ sio_aucat_runmsg(struct sio_aucat_hdl *hdl)
delta = ntohl(hdl->aucat.rmsg.u.ts.delta);
hdl->maxwrite += delta * hdl->wbpf;
hdl->delta += delta;
- DPRINTF("aucat: move = %d, delta = %d, maxwrite = %d\n",
+ DPRINTFN(2, "aucat: move = %d, delta = %d, maxwrite = %d\n",
delta, hdl->delta, hdl->maxwrite);
if (hdl->delta >= 0) {
sio_onmove_cb(&hdl->sio, hdl->delta);
@@ -156,7 +156,7 @@ sio_aucat_open(const char *str, unsigned mode, int nbio)
hdl = malloc(sizeof(struct sio_aucat_hdl));
if (hdl == NULL)
return NULL;
- if (!aucat_open(&hdl->aucat, str, mode)) {
+ if (!aucat_open(&hdl->aucat, str, mode, 0)) {
free(hdl);
return NULL;
}
@@ -466,7 +466,7 @@ sio_aucat_revents(struct sio_hdl *sh, struct pollfd *pfd)
}
if (hdl->sio.eof)
return POLLHUP;
- DPRINTF("sio_aucat_revents: %x\n", revents & hdl->events);
+ DPRINTFN(2, "sio_aucat_revents: %x\n", revents & hdl->events);
return revents & (hdl->events | POLLHUP);
}