summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/sock.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-16 20:44:04 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-16 20:44:04 +0000
commit110322a67c5c9ec93b508d90b6fedc349bf0742c (patch)
treee7158bb50a73e54a631296dd63e8b9f0170f2ed9 /usr.bin/aucat/sock.c
parent2c17af8b4c81ae87457584b92800ef65dd1fdabc (diff)
allow aucat to listen on multiple sockets. Each socket carries its
channel and volume settings allowing multiple configuration to coexist. Mostly useful for envy(4)-like devices, but can be used to force different apps to use different settings.
Diffstat (limited to 'usr.bin/aucat/sock.c')
-rw-r--r--usr.bin/aucat/sock.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/aucat/sock.c b/usr.bin/aucat/sock.c
index c1a3a2094a9..26f345937b8 100644
--- a/usr.bin/aucat/sock.c
+++ b/usr.bin/aucat/sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sock.c,v 1.6 2008/11/16 18:34:56 ratchov Exp $ */
+/* $OpenBSD: sock.c,v 1.7 2008/11/16 20:44:03 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -610,8 +610,8 @@ sock_setpar(struct sock *f)
p->rchan = NCHAN_MAX;
f->wpar.cmin = f->templ_wpar.cmin;
f->wpar.cmax = f->templ_wpar.cmin + p->rchan - 1;
- if (f->wpar.cmax > NCHAN_MAX - 1)
- f->wpar.cmax = NCHAN_MAX - 1;
+ if (f->wpar.cmax > f->templ_wpar.cmax)
+ f->wpar.cmax = f->templ_wpar.cmax;
DPRINTF("sock_setpar: rchan -> %u:%u\n",
f->wpar.cmin, f->wpar.cmax);
}
@@ -621,9 +621,9 @@ sock_setpar(struct sock *f)
if (p->pchan > NCHAN_MAX)
p->pchan = NCHAN_MAX;
f->rpar.cmin = f->templ_rpar.cmin;
- f->rpar.cmax = f->templ_wpar.cmin + p->pchan - 1;
- if (f->rpar.cmax > NCHAN_MAX - 1)
- f->rpar.cmax = NCHAN_MAX - 1;
+ f->rpar.cmax = f->templ_rpar.cmin + p->pchan - 1;
+ if (f->rpar.cmax > f->templ_rpar.cmax)
+ f->rpar.cmax = f->templ_rpar.cmax;
DPRINTF("sock_setpar: pchan -> %u:%u\n",
f->rpar.cmin, f->rpar.cmax);
}