oss4sink: notify "volume" property on open to make apps query initial volume
authorTim-Philipp Müller <tim@centricular.net>
Tue, 25 Dec 2012 16:48:43 +0000 (16:48 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Tue, 25 Dec 2012 16:52:19 +0000 (16:52 +0000)
The initial volume might not be the property default, so
emit a notify on the volume property to make apps get
an up-to-date reading of the current volume.

https://bugzilla.gnome.org/show_bug.cgi?id=631053

sys/oss4/oss4-sink.c

index c15061b..eb3ada0 100644 (file)
@@ -545,7 +545,13 @@ non_block:
 static gboolean
 gst_oss4_sink_open_func (GstAudioSink * asink)
 {
-  return gst_oss4_sink_open (asink, FALSE);
+  if (!gst_oss4_sink_open (asink, FALSE))
+    return FALSE;
+
+  /* the initial volume might not be the property default, so notify
+   * application to make it get a reading of the current volume */
+  g_object_notify (G_OBJECT (asink), "volume");
+  return TRUE;
 }
 
 static gboolean