commit 623bd63f6fea09f3a47f3642cb7a265e92ef23ec
Author: Bastien Nocera <hadess(a)fedoraproject.org>
Date: Mon Jan 7 15:00:08 2008 +0000
- Add upstream patch to fix default track selection on Thinkpads (#344911)
gst-plugins-base-alsa-mixer-thinkpad.patch | 68 ++++++++++++++++++++++++++++++
gstreamer-plugins-base.spec | 11 ++++-
2 files changed, 78 insertions(+), 1 deletion(-)
---
diff --git a/gst-plugins-base-alsa-mixer-thinkpad.patch
b/gst-plugins-base-alsa-mixer-thinkpad.patch
new file mode 100644
index 0000000..fa016b7
--- /dev/null
+++ b/gst-plugins-base-alsa-mixer-thinkpad.patch
@@ -0,0 +1,68 @@
+--- gstalsamixer.c 2008/01/07 13:19:50 1.40
++++ gstalsamixer.c 2008/01/07 13:59:43 1.41
+@@ -591,6 +591,22 @@
+ }
+ }
+
++static gboolean
++check_if_volumes_are_the_same (guint num_channels, gint * volumes)
++{
++ guint i;
++
++ if (num_channels <= 1)
++ return TRUE;
++
++ for (i = 1; i < num_channels; i++) {
++ if (volumes[i] != volumes[0])
++ return FALSE;
++ }
++
++ return TRUE;
++}
++
+ void
+ gst_alsa_mixer_set_volume (GstAlsaMixer * mixer, GstMixerTrack * track,
+ gint * volumes)
+@@ -610,10 +626,17 @@
+ for (i = 0; i < track->num_channels; i++)
+ alsa_track->volumes[i] = volumes[i];
+ } else {
+- for (i = 0; i < track->num_channels; i++) {
+- alsa_track->volumes[i] = volumes[i];
+- snd_mixer_selem_set_playback_volume (alsa_track->element, i,
+- volumes[i]);
++ if (check_if_volumes_are_the_same (track->num_channels, volumes)) {
++ snd_mixer_selem_set_playback_volume_all (alsa_track->element,
++ volumes[0]);
++ for (i = 0; i < track->num_channels; i++)
++ alsa_track->volumes[i] = volumes[0];
++ } else {
++ for (i = 0; i < track->num_channels; i++) {
++ alsa_track->volumes[i] = volumes[i];
++ snd_mixer_selem_set_playback_volume (alsa_track->element, i,
++ volumes[i]);
++ }
+ }
+ }
+
+@@ -622,9 +645,17 @@
+ /* Is emulated record flag activated? */
+ if (track->flags & GST_MIXER_TRACK_RECORD ||
+ alsa_track->alsa_flags & GST_ALSA_MIXER_TRACK_CSWITCH) {
+- for (i = 0; i < track->num_channels; i++) {
+- alsa_track->volumes[i] = volumes[i];
+- snd_mixer_selem_set_capture_volume (alsa_track->element, i, volumes[i]);
++ if (check_if_volumes_are_the_same (track->num_channels, volumes)) {
++ snd_mixer_selem_set_capture_volume_all (alsa_track->element,
++ volumes[0]);
++ for (i = 0; i < track->num_channels; i++)
++ alsa_track->volumes[i] = volumes[0];
++ } else {
++ for (i = 0; i < track->num_channels; i++) {
++ alsa_track->volumes[i] = volumes[i];
++ snd_mixer_selem_set_capture_volume (alsa_track->element, i,
++ volumes[i]);
++ }
+ }
+ } else {
+ for (i = 0; i < track->num_channels; i++)
diff --git a/gstreamer-plugins-base.spec b/gstreamer-plugins-base.spec
index 484ecce..3257074 100644
--- a/gstreamer-plugins-base.spec
+++ b/gstreamer-plugins-base.spec
@@ -5,7 +5,7 @@
Name: %{gstreamer}-plugins-base
Version: 0.10.15
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: GStreamer streaming media framework base plug-ins
Group: Applications/Multimedia
@@ -37,6 +37,8 @@ Obsoletes: gstreamer-plugins
BuildRequires: gtk-doc >= 1.3
BuildRequires: PyXML
+Patch0: gst-plugins-base-alsa-mixer-thinkpad.patch
+
%description
GStreamer is a streaming media framework, based on graphs of filters which
operate on media data. Applications using this library can do anything
@@ -49,6 +51,9 @@ This package contains a set of well-maintained base plug-ins.
%prep
%setup -q -n gst-plugins-base-%{version}
+pushd ext/alsa/
+%patch0 -p0 -b .mixer-thinkpad
+popd
%build
%configure \
@@ -240,6 +245,10 @@ GStreamer Base Plugins library development and header files.
%doc %{_datadir}/gtk-doc/html/gst-plugins-base-plugins-%{majorminor}
%changelog
+* Mon Jan 07 2008 - Bastien Nocera <bnocera(a)redhat.com> - 0.10.15-2
+- Add upstream patch to fix default track selection on Thinkpads
+ (#344911)
+
* Sat Nov 17 2007 - Bastien Nocera <bnocera(a)redhat.com> - 0.10.15-1
- Update to 0.10.15