summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2010-06-05 13:40:47 +0000
committerratchov <ratchov@openbsd.org>2010-06-05 13:40:47 +0000
commitefd92fb38be8a7eb4a8b9a1018111531d590420b (patch)
tree0b78f46896db622af0b5c9bf70bfc31fcbe7caf4 /lib
parentthere is no need to copy the full 802.11 header in ieee80211_decap() (diff)
downloadwireguard-openbsd-efd92fb38be8a7eb4a8b9a1018111531d590420b.tar.xz
wireguard-openbsd-efd92fb38be8a7eb4a8b9a1018111531d590420b.zip
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;