Commit 57b64c00 authored by Thomas Green's avatar Thomas Green Committed by Sebastian Dröge
Browse files

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.
parent 818e869d
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment