summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakemsr <jakemsr@openbsd.org>2008-11-05 21:38:03 +0000
committerjakemsr <jakemsr@openbsd.org>2008-11-05 21:38:03 +0000
commitce98e25143e55633f9983673179aa7133f9cd601 (patch)
tree0ef85d0d57092c983ae42c5e74b738ec299425c5
parentadd missing header needed by strcmp/strerror/memset functions. (diff)
downloadwireguard-openbsd-ce98e25143e55633f9983673179aa7133f9cd601.tar.xz
wireguard-openbsd-ce98e25143e55633f9983673179aa7133f9cd601.zip
return an error when trying to get stereo values from a mono
control. makes mixerctl(1) output more sensible. ok drahn, todd
-rw-r--r--sys/arch/macppc/dev/i2s.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/macppc/dev/i2s.c b/sys/arch/macppc/dev/i2s.c
index e7ccfe87aeb..949426e658e 100644
--- a/sys/arch/macppc/dev/i2s.c
+++ b/sys/arch/macppc/dev/i2s.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2s.c,v 1.15 2008/10/30 06:12:47 todd Exp $ */
+/* $OpenBSD: i2s.c,v 1.16 2008/11/05 21:38:03 jakemsr Exp $ */
/* $NetBSD: i2s.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
@@ -605,12 +605,16 @@ i2s_get_port(h, mc)
return 0;
case I2S_BASS:
+ if (mc->un.value.num_channels != 1)
+ return ENXIO;
mc->un.value.level[AUDIO_MIXER_LEVEL_MONO] = sc->sc_bass;
- return (0);
+ return 0;
case I2S_TREBLE:
+ if (mc->un.value.num_channels != 1)
+ return ENXIO;
mc->un.value.level[AUDIO_MIXER_LEVEL_MONO] = sc->sc_treble;
- return (0);
+ return 0;
case I2S_VOL_INPUT:
/* XXX TO BE DONE */