playbin2: fix initial volume handling also when reusing the element
authorRené Stadler <rene.stadler@nokia.com>
Wed, 10 Jun 2009 14:05:22 +0000 (17:05 +0300)
committerRené Stadler <mail@renestadler.de>
Sat, 27 Jun 2009 13:36:11 +0000 (16:36 +0300)
This is a follow-up to commit 452988, making it work correctly when the audio
chain is reused.

gst/playback/gstplaysink.c

index bf93ba1..c597ad6 100644 (file)
@@ -1552,9 +1552,12 @@ setup_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean queue)
   if (elem) {
     chain->volume = elem;
 
-    GST_DEBUG_OBJECT (playsink, "the sink has a volume property");
-    /* use the sink to control the volume */
-    g_object_set (G_OBJECT (chain->volume), "volume", playsink->volume, NULL);
+    if (playsink->volume_changed) {
+      GST_DEBUG_OBJECT (playsink, "the sink has a volume property, setting %f",
+          playsink->volume);
+      /* use the sink to control the volume */
+      g_object_set (G_OBJECT (chain->volume), "volume", playsink->volume, NULL);
+    }
     /* if the sink also has a mute property we can use this as well. We'll only
      * use the mute property if there is a volume property. We can simulate the
      * mute with the volume otherwise. */