summaryrefslogtreecommitdiff
path: root/lib/libsndio/aucat.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-06-05 12:45:49 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-06-05 12:45:49 +0000
commit50086f252a707f0e817c106badb17f2aa7814784 (patch)
treea48fa80af77d6afc73ca6ec798570993bed27d9d /lib/libsndio/aucat.c
parent34efc00b4042f87181ec69432f8164115bae2208 (diff)
Don't send the initial position as a clock tick with a negative delta.
Add a new ``initial position'' message which is simpler. No bahaviour change, except effects of the protocol version crank.
Diffstat (limited to 'lib/libsndio/aucat.c')
-rw-r--r--lib/libsndio/aucat.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c
index 9ed8f8795cf..27ea95c26d3 100644
--- a/lib/libsndio/aucat.c
+++ b/lib/libsndio/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.38 2010/05/25 06:51:28 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.39 2010/06/05 12:45:48 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -150,16 +150,19 @@ aucat_runmsg(struct aucat_hdl *hdl)
hdl->rstate = STATE_DATA;
hdl->rtodo = hdl->rmsg.u.data.size;
break;
+ case AMSG_POS:
+ DPRINTF("aucat: pos = %d, maxwrite = %u\n",
+ hdl->rmsg.u.ts.delta, hdl->maxwrite);
+ hdl->rstate = STATE_MSG;
+ hdl->rtodo = sizeof(struct amsg);
+ break;
case AMSG_MOVE:
- DPRINTF("aucat: tick, delta = %d\n", hdl->rmsg.u.ts.delta);
- if (hdl->rmsg.u.ts.delta > 0)
- hdl->maxwrite += hdl->rmsg.u.ts.delta * hdl->wbpf;
+ hdl->maxwrite += hdl->rmsg.u.ts.delta * hdl->wbpf;
hdl->delta += hdl->rmsg.u.ts.delta;
- if (hdl->delta >= 0) {
- DPRINTF("aucat: move: maxwrite = %d\n", hdl->maxwrite);
- sio_onmove_cb(&hdl->sio, hdl->delta);
- hdl->delta = 0;
- }
+ DPRINTF("aucat: tick = %d, maxwrite = %u\n",
+ hdl->rmsg.u.ts.delta, hdl->maxwrite);
+ sio_onmove_cb(&hdl->sio, hdl->delta);
+ hdl->delta = 0;
hdl->rstate = STATE_MSG;
hdl->rtodo = sizeof(struct amsg);
break;