diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-11-09 16:26:08 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-11-09 16:26:08 +0000 |
commit | 8fdd47f372326a790dcf725c8cdcfeecbde8aa22 (patch) | |
tree | 724858b4bac54a8befd1ee8cb1d42047ded14761 /usr.bin/aucat/abuf.c | |
parent | 938cca8cc8a2a22f3a8c02c1b034d373103d3017 (diff) |
make aucat(1) stop automatically the audio(1) device if it's idle. This
way, when in server mode, it consumes no CPU if there are no clients.
Later, this will allow to start aucat(1) at session or system startup.
Diffstat (limited to 'usr.bin/aucat/abuf.c')
-rw-r--r-- | usr.bin/aucat/abuf.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.bin/aucat/abuf.c b/usr.bin/aucat/abuf.c index c15b138ad31..d8a92a1f38a 100644 --- a/usr.bin/aucat/abuf.c +++ b/usr.bin/aucat/abuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: abuf.c,v 1.8 2008/11/03 22:25:13 ratchov Exp $ */ +/* $OpenBSD: abuf.c,v 1.9 2008/11/09 16:26:07 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -112,6 +112,20 @@ abuf_del(struct abuf *buf) } /* + * Clear buffer contents + */ +void +abuf_clear(struct abuf *buf) +{ + ABUF_DPR(buf, "abuf_clear:\n"); + buf->used = 0; + buf->start = 0; + buf->abspos = 0; + buf->silence = 0; + buf->drop = 0; +} + +/* * Get a pointer to the readable block at the given offset. */ unsigned char * |