summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-06-05 13:40:48 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-06-05 13:40:48 +0000
commit8425fbbce18b31e191b3b596ae6a1df048d49a76 (patch)
treeb7360449de41bbc6a321a1be6bed8a9f5ca67674 /lib
parentbca605048ac69dd75d1762831fc7e489f90404f7 (diff)
don't send clock ticks while buffers are being primed
Diffstat (limited to 'lib')
-rw-r--r--lib/libsndio/aucat.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c
index 27ea95c26d3..462f45387e6 100644
--- a/lib/libsndio/aucat.c
+++ b/lib/libsndio/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.39 2010/06/05 12:45:48 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.40 2010/06/05 13:40:47 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -153,16 +153,19 @@ aucat_runmsg(struct aucat_hdl *hdl)
case AMSG_POS:
DPRINTF("aucat: pos = %d, maxwrite = %u\n",
hdl->rmsg.u.ts.delta, hdl->maxwrite);
+ hdl->delta = hdl->rmsg.u.ts.delta;
hdl->rstate = STATE_MSG;
hdl->rtodo = sizeof(struct amsg);
break;
case AMSG_MOVE:
hdl->maxwrite += hdl->rmsg.u.ts.delta * hdl->wbpf;
hdl->delta += hdl->rmsg.u.ts.delta;
- DPRINTF("aucat: tick = %d, maxwrite = %u\n",
- hdl->rmsg.u.ts.delta, hdl->maxwrite);
- sio_onmove_cb(&hdl->sio, hdl->delta);
- hdl->delta = 0;
+ DPRINTF("aucat: move = %d, delta = %d, maxwrite = %u\n",
+ hdl->rmsg.u.ts.delta, hdl->delta, hdl->maxwrite);
+ if (hdl->delta >= 0) {
+ sio_onmove_cb(&hdl->sio, hdl->delta);
+ hdl->delta = 0;
+ }
hdl->rstate = STATE_MSG;
hdl->rtodo = sizeof(struct amsg);
break;