diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-08-14 09:47:52 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-08-14 09:47:52 +0000 |
commit | bbe89da068e007184794faab6172f819027c8882 (patch) | |
tree | 45530d22d918b427bde499120292c5249ee72dc0 | |
parent | ca9a45ed44195cc5bb461d4d3f5b67e9f8d4e71b (diff) |
add an "AUTOQUIT" flag to mix and sub aprocs. If the flag is
set, the mix aproc will exit once there are no more input
streams, similarly the sub aproc will exit once there are no
more ouput streams. If the flag is not set, the mix aproc will
generate silence, and the sub aproc will drop samples. By
default this flag is set, so no behaviour change.
ok jakemsr
-rw-r--r-- | usr.bin/aucat/aproc.c | 6 | ||||
-rw-r--r-- | usr.bin/aucat/aproc.h | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/aucat/aproc.c b/usr.bin/aucat/aproc.c index f780d456e18..aa358a71052 100644 --- a/usr.bin/aucat/aproc.c +++ b/usr.bin/aucat/aproc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aproc.c,v 1.8 2008/08/14 09:45:23 ratchov Exp $ */ +/* $OpenBSD: aproc.c,v 1.9 2008/08/14 09:47:51 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -395,7 +395,7 @@ mix_out(struct aproc *p, struct abuf *obuf) } if (ocount == 0) return 0; - if (LIST_EMPTY(&p->ibuflist)) { + if (LIST_EMPTY(&p->ibuflist) && (p->u.mix.flags & MIX_AUTOQUIT)) { DPRINTF("mix_out: nothing more to do...\n"); obuf->wproc = NULL; aproc_del(p); @@ -600,7 +600,7 @@ sub_hup(struct aproc *p, struct abuf *obuf) DPRINTF("sub_hup: %s: detached\n", p->name); sub_rm(p, obuf); - if (LIST_EMPTY(&p->obuflist)) { + if (LIST_EMPTY(&p->obuflist) && (p->u.sub.flags & SUB_AUTOQUIT)) { abuf_hup(ibuf); aproc_del(p); } else diff --git a/usr.bin/aucat/aproc.h b/usr.bin/aucat/aproc.h index 51dac1155ac..26cd5a77136 100644 --- a/usr.bin/aucat/aproc.h +++ b/usr.bin/aucat/aproc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aproc.h,v 1.3 2008/08/14 09:45:23 ratchov Exp $ */ +/* $OpenBSD: aproc.h,v 1.4 2008/08/14 09:47:51 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -136,11 +136,13 @@ struct aproc { struct aconv ist, ost; } conv; struct { -#define MIX_DROP 1 +#define MIX_DROP 1 +#define MIX_AUTOQUIT 2 unsigned flags; } mix; struct { -#define SUB_DROP 1 +#define SUB_DROP 1 +#define SUB_AUTOQUIT 2 unsigned flags; } sub; } u; |