Commit 7034b92d authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

winealsa: Add special case for microphone source in mixer.

Some microphones don't have a capture control, but a playback control instead. So use the playback volume, but still register it as capture volume.
parent 82a199bc
...@@ -371,7 +371,8 @@ static void filllines(mixer *mmixer, snd_mixer_elem_t *mastelem, snd_mixer_elem_ ...@@ -371,7 +371,8 @@ static void filllines(mixer *mmixer, snd_mixer_elem_t *mastelem, snd_mixer_elem_
const char * name = snd_mixer_selem_get_name(elem); const char * name = snd_mixer_selem_get_name(elem);
DWORD comp = getcomponenttype(name); DWORD comp = getcomponenttype(name);
if (snd_mixer_selem_has_playback_volume(elem)) if (snd_mixer_selem_has_playback_volume(elem) &&
(snd_mixer_selem_has_capture_volume(elem) || comp != MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE))
{ {
(++mline)->component = comp; (++mline)->component = comp;
MultiByteToWideChar(CP_UNIXCP, 0, name, -1, mline->name, MAXPNAMELEN); MultiByteToWideChar(CP_UNIXCP, 0, name, -1, mline->name, MAXPNAMELEN);
...@@ -382,7 +383,7 @@ static void filllines(mixer *mmixer, snd_mixer_elem_t *mastelem, snd_mixer_elem_ ...@@ -382,7 +383,7 @@ static void filllines(mixer *mmixer, snd_mixer_elem_t *mastelem, snd_mixer_elem_
else if (!capt) else if (!capt)
continue; continue;
if (capt && snd_mixer_selem_has_capture_volume(elem)) if (capt && (snd_mixer_selem_has_capture_volume(elem) || comp == MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE))
{ {
(++mline)->component = comp; (++mline)->component = comp;
MultiByteToWideChar(CP_UNIXCP, 0, name, -1, mline->name, MAXPNAMELEN); MultiByteToWideChar(CP_UNIXCP, 0, name, -1, mline->name, MAXPNAMELEN);
...@@ -473,9 +474,19 @@ static void ALSA_MixerInit(void) ...@@ -473,9 +474,19 @@ static void ALSA_MixerInit(void)
captelem = elem; captelem = elem;
else if (!blacklisted(elem)) else if (!blacklisted(elem))
{ {
DWORD comp = getcomponenttype(snd_mixer_selem_get_name(elem));
DWORD skip = 0;
/* Work around buggy drivers: Make this a capture control if the name is recognised as a microphone */
if (snd_mixer_selem_has_capture_volume(elem)) if (snd_mixer_selem_has_capture_volume(elem))
++capcontrols; ++capcontrols;
if (snd_mixer_selem_has_playback_volume(elem)) else if (comp == MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE)
{
++capcontrols;
skip = 1;
}
if (!skip && snd_mixer_selem_has_playback_volume(elem))
{ {
if (!strcasecmp(snd_mixer_selem_get_name(elem), "Headphone") && !headelem) if (!strcasecmp(snd_mixer_selem_get_name(elem), "Headphone") && !headelem)
headelem = elem; headelem = 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