summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-11 13:12:04 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-11 13:12:04 +0000
commit6dfc7596a14514e9a18680b9da1e23bb00afe957 (patch)
treea1f18520d92e4636062b38a1c98faa01c4d709ae
parent6ded11df2bec40fb5c723cb16cd840d0a6a45c17 (diff)
termninate non-server aucat when it's idle rather that using
the hackish {MIX,SUB}_AUTOQUIT features. This way we don't have to care about possible references on destroyed objects.
-rw-r--r--usr.bin/aucat/aucat.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 2c1a5a5ffd7..501c37e070f 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.36 2008/11/11 12:56:02 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.37 2008/11/11 13:12:03 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -482,16 +482,6 @@ main(int argc, char **argv)
}
/*
- * automatically terminate when there no are streams
- */
- if (!l_flag) {
- if (dev_mix)
- dev_mix->u.mix.flags |= MIX_AUTOQUIT;
- if (dev_sub)
- dev_sub->u.sub.flags |= SUB_AUTOQUIT;
- }
-
- /*
* loop, start audio
*/
for (;;) {
@@ -502,10 +492,10 @@ main(int argc, char **argv)
}
if (!file_poll())
break;
- if (!l_flag)
- continue;
if ((!dev_mix || dev_mix->u.mix.idle > 2 * dev_bufsz) &&
(!dev_sub || dev_sub->u.sub.idle > 2 * dev_bufsz)) {
+ if (!l_flag)
+ break;
if (!suspend) {
DPRINTF("suspending\n");
suspend = 1;
@@ -527,8 +517,7 @@ main(int argc, char **argv)
suspend = 0;
dev_start();
}
- if (l_flag)
- dev_done();
+ dev_done();
filelist_done();
sigfillset(&sa.sa_mask);