summaryrefslogtreecommitdiff
path: root/usr.bin/aucat
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-08-27 06:54:24 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-08-27 06:54:24 +0000
commitb3baf292bef2f1b1576a62e78118468f37e473a7 (patch)
treec4ccc6287df0423128657cd21b945eb0e1e41b9f /usr.bin/aucat
parent296893f40a0b2cf432a6f4e28905aa27398dbf78 (diff)
don't discard the initial volume change message; now it matters
because the initial volume may not be MIDI_MAXCTL
Diffstat (limited to 'usr.bin/aucat')
-rw-r--r--usr.bin/aucat/sock.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/aucat/sock.c b/usr.bin/aucat/sock.c
index 637a3e9fd69..2c0e0705366 100644
--- a/usr.bin/aucat/sock.c
+++ b/usr.bin/aucat/sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sock.c,v 1.26 2009/08/27 06:31:13 ratchov Exp $ */
+/* $OpenBSD: sock.c,v 1.27 2009/08/27 06:54:23 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -372,8 +372,6 @@ sock_setvol(void *arg, unsigned vol)
struct abuf *rbuf;
f->vol = vol;
- if (f->pstate <= SOCK_START)
- f->lastvol = f->vol;
rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
if (!rbuf) {
DPRINTF("sock_setvol: no read buffer yet\n");
@@ -1004,7 +1002,7 @@ sock_buildmsg(struct sock *f)
/*
* if volume changed build a SETVOL message
*/
- if (f->vol != f->lastvol) {
+ if (f->pstate >= SOCK_START && f->vol != f->lastvol) {
DPRINTFN(4, "sock_buildmsg: %p: SETVOL: %d\n", f, f->vol);
AMSG_INIT(&f->wmsg);
f->wmsg.cmd = AMSG_SETVOL;