playsink: If notify::{volume,mute} is triggered by the volume element, update our...
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 30 Oct 2009 08:24:03 +0000 (09:24 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 30 Oct 2009 08:24:03 +0000 (09:24 +0100)
gst/playback/gstplaysink.c

index 9809196..a481203 100644 (file)
@@ -1422,15 +1422,24 @@ gen_subp_chain (GstPlaySink * playsink)
 }
 
 static void
-notify_volume_cb (GObject * selector, GParamSpec * pspec,
-    GstPlaySink * playsink)
+notify_volume_cb (GObject * object, GParamSpec * pspec, GstPlaySink * playsink)
 {
+  gdouble vol;
+
+  g_object_get (object, "volume", &vol, NULL);
+  playsink->volume = vol;
+
   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)
 {
+  gboolean mute;
+
+  g_object_get (object, "mute", &mute, NULL);
+  playsink->mute = mute;
+
   g_object_notify (G_OBJECT (playsink), "mute");
 }