diff options
author | 2006-06-17 18:38:12 +0000 | |
---|---|---|
committer | 2006-06-17 18:38:12 +0000 | |
commit | bc32fbdffab4512e9e948383dd6a6dd5f27c6c77 (patch) | |
tree | d8beb87256e86bc2a6ea84e78a0b97d5cffcd6c8 | |
parent | - re-enable AMRR (diff) | |
download | wireguard-openbsd-bc32fbdffab4512e9e948383dd6a6dd5f27c6c77.tar.xz wireguard-openbsd-bc32fbdffab4512e9e948383dd6a6dd5f27c6c77.zip |
Fix a bug that AUDIO_MIXER_READ returns an incorrect
mixer_ctrl_t::un.value.num_channels in the case of the
combination of a mono pin and a stereo mixer.
From kent NetBSD
-rw-r--r-- | sys/dev/pci/azalia_codec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c index a0a25e53d78..1e449c47915 100644 --- a/sys/dev/pci/azalia_codec.c +++ b/sys/dev/pci/azalia_codec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia_codec.c,v 1.13 2006/06/16 08:03:42 brad Exp $ */ +/* $OpenBSD: azalia_codec.c,v 1.14 2006/06/17 18:38:12 brad Exp $ */ /* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */ /*- @@ -854,6 +854,7 @@ int azalia_generic_mixer_get(const codec_t *this, nid_t nid, int target, mixer_ctrl_t *mc) { uint32_t result; + nid_t n; int err; /* inamp mute */ @@ -875,7 +876,8 @@ azalia_generic_mixer_get(const codec_t *this, nid_t nid, int target, mixer_ctrl_ return err; mc->un.value.level[0] = azalia_generic_mixer_from_device_value(this, nid, target, CORB_GAGM_GAIN(result)); - mc->un.value.num_channels = WIDGET_CHANNELS(&this->w[nid]); + n = this->w[nid].connections[MI_TARGET_INAMP(target)]; + mc->un.value.num_channels = WIDGET_CHANNELS(&this->w[n]); if (mc->un.value.num_channels == 2) { err = this->comresp(this, nid, CORB_GET_AMPLIFIER_GAIN_MUTE, CORB_GAGM_INPUT | |