mirror of
https://github.com/openbsd/src.git
synced 2025-01-10 06:47:55 -08:00
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.
This commit is contained in:
parent
5e429d4b6c
commit
c4e6537041
@ -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>
|
||||
*
|
||||
@ -481,16 +481,6 @@ main(int argc, char **argv)
|
||||
free(fa);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user