ext/alsa/gstalsamixer.c: Also consider "speaker" as a name for master volume. If that doesn't help look for the first...

Original commit message from CVS:
* ext/alsa/gstalsamixer.c:
Also consider "speaker" as a name for master volume. If that doesn't
help look for the first non-mono volume control that also has a
playback switch.
This commit is contained in:
Stefan Kost 2008-06-24 16:15:26 +00:00
parent 1598b58bbe
commit 1834a009a1
2 changed files with 30 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2008-06-24 Stefan Kost <ensonic@users.sf.net>
* ext/alsa/gstalsamixer.c:
Also consider "speaker" as a name for master volume. If that doesn't
help look for the first non-mono volume control that also has a
playback switch.
2008-06-24 Stefan Kost <ensonic@users.sf.net>
* ChangeLog:

View file

@ -165,7 +165,29 @@ gst_alsa_mixer_find_master_mixer (GstAlsaMixer * mixer, snd_mixer_t * handle)
element = snd_mixer_elem_next (element);
}
/* If not, check if we have a playback mixer with both volume and switch */
/* If not, check if we have a playback mixer labelled as 'Speaker' */
element = snd_mixer_first_elem (handle);
for (i = 0; i < count; i++) {
if (snd_mixer_selem_has_playback_volume (element) &&
strcmp (snd_mixer_selem_get_name (element), "Speaker") == 0) {
return element;
}
element = snd_mixer_elem_next (element);
}
/* If not, check if we have a playback mixer with both volume and switch that
* is not mono */
element = snd_mixer_first_elem (handle);
for (i = 0; i < count; i++) {
if (snd_mixer_selem_has_playback_volume (element) &&
snd_mixer_selem_has_playback_switch (element) &&
!snd_mixer_selem_is_playback_mono (element)) {
return element;
}
element = snd_mixer_elem_next (element);
}
/* If not, check if we have any playback mixer with both volume and switch */
element = snd_mixer_first_elem (handle);
for (i = 0; i < count; i++) {
if (snd_mixer_selem_has_playback_volume (element) &&