summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2007-09-09 02:55:19 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2007-09-09 02:55:19 +0000
commitb4558cf6db8c18d385526bc25298869b589ca5d8 (patch)
tree12f2d80802cb9ac4caa0c7e8a7173aaa2b14a5c4 /sys
parent7991ec492d7afa1200992f730e94707ae617ef99 (diff)
don't try to set the recording gain or balance through /dev/audio[ctl]
if the selected recording port is not a port the limited /dev/audio[ctl] interface to mixer controls supports. ok ratchov@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/audio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 11ccda51d99..30f5b17a3ae 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.72 2007/08/08 05:51:23 jakemsr Exp $ */
+/* $OpenBSD: audio.c,v 1.73 2007/09/09 02:55:18 jakemsr Exp $ */
/* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */
/*
@@ -2625,7 +2625,7 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
if (error)
return(error);
}
- if (r->gain != ~0) {
+ if ((r->gain != ~0) && (r->port != 0)) {
au_get_gain(sc, &sc->sc_inports, &gain, &balance);
error = au_set_gain(sc, &sc->sc_inports, r->gain, balance);
if (error)
@@ -2638,7 +2638,7 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
if (error)
return(error);
}
- if (r->balance != (u_char)~0) {
+ if ((r->balance != (u_char)~0) && (r->port != 0)) {
au_get_gain(sc, &sc->sc_inports, &gain, &balance);
error = au_set_gain(sc, &sc->sc_inports, gain, r->balance);
if (error)