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.
This commit is contained in:
René Stadler 2009-06-10 17:05:22 +03:00 committed by René Stadler
parent 07c237ad19
commit 61441ff183

View 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. */