From 06b3dec4993ee410483cf2ede076d4cba83009a3 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 7 Jan 2008 13:19:50 +0000 Subject: [PATCH] ext/alsa/gstalsamixer.c: If there's no mixer track by the name of 'Master' or 'Front', check if there's one called 'P... Original commit message from CVS: Patch by: Jerone Young * ext/alsa/gstalsamixer.c: (gst_alsa_mixer_find_master_mixer): If there's no mixer track by the name of 'Master' or 'Front', check if there's one called 'PCM' before trying the generic fallback logic (fixes #506928, where we pick 'Mic' as master track for the AD1984 card in a Thinkpad T61/X61 laptop). --- ChangeLog | 10 ++++++++++ ext/alsa/gstalsamixer.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index ad2e526..70308f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-01-07 Tim-Philipp Müller + + Patch by: Jerone Young + + * ext/alsa/gstalsamixer.c: (gst_alsa_mixer_find_master_mixer): + If there's no mixer track by the name of 'Master' or 'Front', + check if there's one called 'PCM' before trying the generic + fallback logic (fixes #506928, where we pick 'Mic' as master + track for the AD1984 card in a Thinkpad T61/X61 laptop). + 2008-01-07 Wim Taymans * gst/playback/gstplay-enum.c: diff --git a/ext/alsa/gstalsamixer.c b/ext/alsa/gstalsamixer.c index 18a71a9..8aa5311 100644 --- a/ext/alsa/gstalsamixer.c +++ b/ext/alsa/gstalsamixer.c @@ -155,6 +155,16 @@ 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 labelled as 'PCM' */ + 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), "PCM") == 0) { + return element; + } + element = snd_mixer_elem_next (element); + } + /* If not, check if we have a playback mixer with both volume and switch */ element = snd_mixer_first_elem (handle); for (i = 0; i < count; i++) { -- 2.7.4