diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2016-05-27 16:02:55 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2016-05-27 16:02:55 +0000 |
commit | 70a3e5e9e27ab5836b85eb2f14b84a021907d36e (patch) | |
tree | 55a05bf4f8cc29950a75d62ddcd1981118fc077e /usr.bin/aucat | |
parent | 635c92eef75e489974d951ff7e6c531dfc612452 (diff) |
Flush rec buffer if there's less than one block space left and refill
play buffer if there's less than one block of data left. This is the
correct condition in the general case. No behaviour change, as all
input/output is multiple of the block size.
Diffstat (limited to 'usr.bin/aucat')
-rw-r--r-- | usr.bin/aucat/aucat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index f315cfeb526..6e025813f7b 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -975,9 +975,11 @@ slot_list_iodo(void) for (s = slot_list; s != NULL; s = s->next) { if (s->pstate != SLOT_RUN) continue; - if ((s->mode & SIO_PLAY) && (s->buf.used == 0)) + if ((s->mode & SIO_PLAY) && + (s->buf.used < s->round * s->bpf)) slot_fill(s); - if ((s->mode & SIO_REC) && (s->buf.used == s->buf.len)) + if ((s->mode & SIO_REC) && + (s->buf.len - s->buf.used < s->round * s->bpf)) slot_flush(s); } } |