Commit e96d3d53 authored by Jeff Cook's avatar Jeff Cook Committed by Alexandre Julliard

winealsa.drv: Only set micelem as master if there are no other elems on this card.

parent c3dfc7b8
......@@ -431,7 +431,7 @@ static void ALSA_MixerInit(void)
info = HeapAlloc( GetProcessHeap(), 0, snd_ctl_card_info_sizeof());
for (x = 0; x < MAX_MIXERS; ++x)
{
int card, err, capcontrols = 0;
int card, err, capcontrols, total_elems = 0;
char cardind[6], cardname[10];
snd_ctl_t *ctl;
......@@ -486,12 +486,15 @@ static void ALSA_MixerInit(void)
/* First, lets see what's available..
* If there are multiple Master or Captures, all except 1 will be added as slaves
*/
total_elems = snd_mixer_get_count(mixdev[mixnum].mix);
TRACE("Total elems: %d\n", total_elems);
for (elem = snd_mixer_first_elem(mixdev[mixnum].mix); elem; elem = snd_mixer_elem_next(elem))
if (!strcasecmp(snd_mixer_selem_get_name(elem), "Master") && !mastelem)
mastelem = elem;
else if (!strcasecmp(snd_mixer_selem_get_name(elem), "Capture") && !captelem)
captelem = elem;
else if (!strcasecmp(snd_mixer_selem_get_name(elem), "Mic") && !micelem && !mastelem)
else if (!strcasecmp(snd_mixer_selem_get_name(elem), "Mic") && !micelem && !mastelem && total_elems == 1)
/* this is what snd-usb-audio mics look like; just a Mic control and that's it.*/
micelem = elem;
else if (!blacklisted(elem))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment