commit 5a00622c39d8387c23c9d378b3429077d76810d1
Author: Bastien Nocera <hadess(a)fedoraproject.org>
Date: Tue Nov 3 14:21:05 2009 +0000
- Update volume notification patch
...otify.patch => gstpb-playbin-proxy-volume.patch | 115 ++++++++++++++++-----
gstreamer-plugins-base.spec | 7 +-
2 files changed, 93 insertions(+), 29 deletions(-)
---
diff --git a/gstpb-playbin-notify.patch b/gstpb-playbin-proxy-volume.patch
similarity index 68%
rename from gstpb-playbin-notify.patch
rename to gstpb-playbin-proxy-volume.patch
index 363b541..5eeab44 100644
--- a/gstpb-playbin-notify.patch
+++ b/gstpb-playbin-proxy-volume.patch
@@ -1,3 +1,38 @@
+diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c
+index 1387a80..643c763 100644
+--- a/gst/playback/gstplaybin2.c
++++ b/gst/playback/gstplaybin2.c
+@@ -1091,6 +1091,18 @@ free_group (GstPlayBin * playbin, GstSourceGroup * group)
+ }
+
+ static void
++notify_volume_cb (GObject * selector, GParamSpec * pspec, GstPlayBin * playbin)
++{
++ g_object_notify (G_OBJECT (playbin), "volume");
++}
++
++static void
++notify_mute_cb (GObject * selector, GParamSpec * pspec, GstPlayBin * playbin)
++{
++ g_object_notify (G_OBJECT (playbin), "mute");
++}
++
++static void
+ gst_play_bin_init (GstPlayBin * playbin)
+ {
+ GstFactoryListType type;
+@@ -1116,6 +1128,11 @@ gst_play_bin_init (GstPlayBin * playbin)
+ playbin->playsink = g_object_new (GST_TYPE_PLAY_SINK, NULL);
+ gst_bin_add (GST_BIN_CAST (playbin), GST_ELEMENT_CAST (playbin->playsink));
+ gst_play_sink_set_flags (playbin->playsink, DEFAULT_FLAGS);
++ /* Connect to notify::volume and notify::mute signals for proxying */
++ g_signal_connect (playbin->playsink, "notify::volume",
++ G_CALLBACK (notify_volume_cb), playbin);
++ g_signal_connect (playbin->playsink, "notify::mute",
++ G_CALLBACK (notify_mute_cb), playbin);
+
+ playbin->encoding = g_strdup (DEFAULT_SUBTITLE_ENCODING);
+
diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
index 85f7abd..9809196 100644
--- a/gst/playback/gstplaysink.c
@@ -86,38 +121,64 @@ index 85f7abd..9809196 100644
chain->volume = NULL;
chain->mute = NULL;
} else {
-diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c
-index 1387a80..643c763 100644
---- a/gst/playback/gstplaybin2.c
-+++ b/gst/playback/gstplaybin2.c
-@@ -1091,6 +1091,18 @@ free_group (GstPlayBin * playbin, GstSourceGroup * group)
+diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
+index 9809196..a481203 100644
+--- a/gst/playback/gstplaysink.c
++++ b/gst/playback/gstplaysink.c
+@@ -1422,15 +1422,24 @@ gen_subp_chain (GstPlaySink * playsink)
}
static void
-+notify_volume_cb (GObject * selector, GParamSpec * pspec, GstPlayBin * playbin)
-+{
-+ g_object_notify (G_OBJECT (playbin), "volume");
-+}
+-notify_volume_cb (GObject * selector, GParamSpec * pspec,
+- GstPlaySink * playsink)
++notify_volume_cb (GObject * object, GParamSpec * pspec, GstPlaySink * playsink)
+ {
++ gdouble vol;
+
-+static void
-+notify_mute_cb (GObject * selector, GParamSpec * pspec, GstPlayBin * playbin)
-+{
-+ g_object_notify (G_OBJECT (playbin), "mute");
-+}
++ g_object_get (object, "volume", &vol, NULL);
++ playsink->volume = vol;
+
-+static void
- gst_play_bin_init (GstPlayBin * playbin)
+ g_object_notify (G_OBJECT (playsink), "volume");
+ }
+
+ static void
+-notify_mute_cb (GObject * selector, GParamSpec * pspec, GstPlaySink * playsink)
++notify_mute_cb (GObject * object, GParamSpec * pspec, GstPlaySink * playsink)
{
- GstFactoryListType type;
-@@ -1116,6 +1128,11 @@ gst_play_bin_init (GstPlayBin * playbin)
- playbin->playsink = g_object_new (GST_TYPE_PLAY_SINK, NULL);
- gst_bin_add (GST_BIN_CAST (playbin), GST_ELEMENT_CAST (playbin->playsink));
- gst_play_sink_set_flags (playbin->playsink, DEFAULT_FLAGS);
-+ /* Connect to notify::volume and notify::mute signals for proxying */
-+ g_signal_connect (playbin->playsink, "notify::volume",
-+ G_CALLBACK (notify_volume_cb), playbin);
-+ g_signal_connect (playbin->playsink, "notify::mute",
-+ G_CALLBACK (notify_mute_cb), playbin);
++ gboolean mute;
++
++ g_object_get (object, "mute", &mute, NULL);
++ playsink->mute = mute;
++
+ g_object_notify (G_OBJECT (playsink), "mute");
+ }
- playbin->encoding = g_strdup (DEFAULT_SUBTITLE_ENCODING);
+diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
+index a481203..8c89203 100644
+--- a/gst/playback/gstplaysink.c
++++ b/gst/playback/gstplaysink.c
+@@ -1538,6 +1538,7 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean
queue)
+ /* use the sink to control the volume and mute */
+ if (playsink->volume_changed) {
+ g_object_set (G_OBJECT (chain->volume), "volume",
playsink->volume, NULL);
++ playsink->volume_changed = FALSE;
+ }
+ if (playsink->mute_changed) {
+ if (chain->mute) {
+@@ -1546,6 +1547,7 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean
queue)
+ if (playsink->mute)
+ g_object_set (chain->volume, "volume", (gdouble) 0.0, NULL);
+ }
++ playsink->mute_changed = FALSE;
+ }
+ } else {
+ /* no volume, we need to add a volume element when we can */
+@@ -1718,6 +1720,7 @@ setup_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean
queue)
+ playsink->volume);
+ /* use the sink to control the volume */
+ g_object_set (G_OBJECT (chain->volume), "volume",
playsink->volume, NULL);
++ playsink->volume_changed = FALSE;
+ }
+ g_signal_connect (chain->volume, "notify::volume",
+
diff --git a/gstreamer-plugins-base.spec b/gstreamer-plugins-base.spec
index 316ab0e..b61ec9e 100644
--- a/gstreamer-plugins-base.spec
+++ b/gstreamer-plugins-base.spec
@@ -42,8 +42,8 @@ Patch1: gstpb-fix-missing-plugins.patch
#
https://bugzilla.gnome.org/show_bug.cgi?id=599105
Patch2: pulsesink-disable-old-version-hack.patch
Conflicts: gstreamer-plugins-good < 0.10.16-3
-#
https://bugzilla.gnome.org/show_bug.cgi?id=600027
-Patch3: gstpb-playbin-notify.patch
+#
https://bugzilla.gnome.org/show_bug.cgi?id=596164#c12
+Patch3: gstpb-playbin-proxy-volume.patch
# documentation
BuildRequires: gtk-doc >= 1.3
@@ -260,6 +260,9 @@ GStreamer Base Plugins library development and header files.
%doc %{_datadir}/gtk-doc/html/gst-plugins-base-plugins-%{majorminor}
%changelog
+* Tue Nov 03 2009 Bastien Nocera <bnocera(a)redhat.com> 0.10.25-5
+- Update volume notification patch
+
* Thu Oct 29 2009 Bastien Nocera <bnocera(a)redhat.com> 0.10.25-4
- Make playbin push volume changes to the front-end