From 61441ff18333e2f81d0430fd66f71d4f2eccdbad Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ren=C3=A9=20Stadler?= Date: Wed, 10 Jun 2009 17:05:22 +0300 Subject: [PATCH] playbin2: fix initial volume handling also when reusing the element This is a follow-up to commit 452988, making it work correctly when the audio chain is reused. --- gst/playback/gstplaysink.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index bf93ba1235..c597ad6682 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -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. */ -- 2.34.1