From 016f1a0ab32171b68e64f9180970978adfa21a52 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sat, 17 Jun 2006 18:38:13 +0000 Subject: 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 --- sys/dev/pci/azalia_codec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/dev/pci/azalia_codec.c') 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 | -- cgit v1.2.3