playbin: Only unref the volume element on dispose and when a new audio sink is set

Unreffing it whenever the sinks are removed will make the volume
element unavailable after a playbin reuse because it is only
recreated if the audio sink has changed.

Fixes bug #614288.
This commit is contained in:
Thomas Green 2010-04-09 08:23:33 +02:00 committed by Sebastian Dröge
parent 818e869d70
commit 57b64c001a

View file

@ -483,6 +483,10 @@ gst_play_bin_dispose (GObject * object)
gst_object_unref (play_bin->textoverlay_element);
play_bin->textoverlay_element = NULL;
}
if (play_bin->volume_element) {
gst_object_unref (play_bin->volume_element);
play_bin->volume_element = NULL;
}
if (play_bin->spu_element != NULL) {
gst_object_unref (play_bin->spu_element);
play_bin->spu_element = NULL;
@ -639,6 +643,10 @@ gst_play_bin_set_property (GObject * object, guint prop_id,
if (play_bin->audio_sink != NULL) {
gst_object_unref (play_bin->audio_sink);
}
if (play_bin->volume_element != NULL) {
gst_object_unref (play_bin->volume_element);
play_bin->volume_element = NULL;
}
play_bin->audio_sink = g_value_get_object (value);
if (play_bin->audio_sink != NULL) {
gst_object_ref (play_bin->audio_sink);
@ -1440,11 +1448,6 @@ remove_sinks (GstPlayBin * play_bin)
gst_object_unref (play_bin->textoverlay_element);
play_bin->textoverlay_element = NULL;
}
if (play_bin->volume_element) {
gst_object_unref (play_bin->volume_element);
play_bin->volume_element = NULL;
}
}
/* loop over the streams and set up the pipeline to play this