diff options
author | 2011-11-15 08:05:22 +0000 | |
---|---|---|
committer | 2011-11-15 08:05:22 +0000 | |
commit | b395609868171dda79778399742da4042c7d40db (patch) | |
tree | f4f72c7c677213b01364f957b5ac3d13fa3811dd /lib/libsndio/sio_aucat.c | |
parent | Don't do non-512 writes to vnd. ok matthew (diff) | |
download | wireguard-openbsd-b395609868171dda79778399742da4042c7d40db.tar.xz wireguard-openbsd-b395609868171dda79778399742da4042c7d40db.zip |
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.c | 8 |
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); } |