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
-/* $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>
*
}
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);
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
-/* $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>
*
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;