From b4558cf6db8c18d385526bc25298869b589ca5d8 Mon Sep 17 00:00:00 2001 From: Jacob Meuser Date: Sun, 9 Sep 2007 02:55:19 +0000 Subject: 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@ --- sys/dev/audio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys') 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) -- cgit v1.2.3