diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2009-10-10 13:55:38 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2009-10-10 13:55:38 +0000 |
commit | 1e4a2d1970a402b97d119396cf414c3640d040f4 (patch) | |
tree | 3a0a53473bac26a7a3149b28cffd3f40a4f98e84 /usr.bin/aucat | |
parent | 96782ef80dd52562aa753c36cf4d4abe6b426b64 (diff) |
don't use a references to the device file to check the current mode
Diffstat (limited to 'usr.bin/aucat')
-rw-r--r-- | usr.bin/aucat/aucat.c | 6 | ||||
-rw-r--r-- | usr.bin/aucat/dev.h | 6 | ||||
-rw-r--r-- | usr.bin/aucat/sock.c | 10 |
3 files changed, 10 insertions, 12 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index 792684ad3c2..bd3c8079e4b 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.71 2009/10/10 12:43:09 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.72 2009/10/10 13:55:37 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -590,8 +590,8 @@ aucat_main(int argc, char **argv) if (quit_flag) { break; } - if ((!dev_rec || dev_rec->u.io.file == NULL) && - (!dev_play || dev_play->u.io.file == NULL) && !n_flag) { + if ((dev_mix && LIST_EMPTY(&dev_mix->obuflist)) || + (dev_sub && LIST_EMPTY(&dev_sub->ibuflist))) { fprintf(stderr, "device desappeared, terminating\n"); break; } diff --git a/usr.bin/aucat/dev.h b/usr.bin/aucat/dev.h index 95b119896cd..1ea74b2d661 100644 --- a/usr.bin/aucat/dev.h +++ b/usr.bin/aucat/dev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.h,v 1.13 2009/10/09 16:49:48 ratchov Exp $ */ +/* $OpenBSD: dev.h,v 1.14 2009/10/10 13:55:37 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -23,14 +23,12 @@ struct abuf; extern unsigned dev_bufsz, dev_round, dev_rate; extern struct aparams dev_ipar, dev_opar; -extern struct aproc *dev_mix, *dev_sub, *dev_rec, *dev_play, *dev_midi; +extern struct aproc *dev_mix, *dev_sub, *dev_midi; void dev_thruinit(void); -void dev_thrudone(void); void dev_midiattach(struct abuf *, struct abuf *); unsigned dev_roundof(unsigned); void dev_loopinit(struct aparams *, struct aparams *, unsigned); -void dev_loopdone(void); int dev_init(char *, struct aparams *, struct aparams *, unsigned); void dev_start(void); void dev_stop(void); diff --git a/usr.bin/aucat/sock.c b/usr.bin/aucat/sock.c index d293cc1982f..9aecb23a7ef 100644 --- a/usr.bin/aucat/sock.c +++ b/usr.bin/aucat/sock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sock.c,v 1.30 2009/10/05 07:05:24 ratchov Exp $ */ +/* $OpenBSD: sock.c,v 1.31 2009/10/10 13:55:37 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -272,9 +272,9 @@ sock_new(struct fileops *ops, int fd) f->mode = 0; f->opt = opt_byname("default"); if (f->opt) { - if (dev_rec) + if (dev_sub) f->wpar = f->opt->wpar; - if (dev_play) + if (dev_mix) f->rpar = f->opt->rpar; } f->xrun = AMSG_IGNORE; @@ -688,9 +688,9 @@ sock_hello(struct sock *f) f->opt = opt_byname(p->opt); if (f->opt == NULL) return 0; - if (dev_rec) + if (dev_sub) f->wpar = f->opt->wpar; - if (dev_play) + if (dev_mix) f->rpar = f->opt->rpar; if ((p->proto & ~(AMSG_PLAY | AMSG_REC)) != 0 || (p->proto & (AMSG_PLAY | AMSG_REC)) == 0) { |