Commit 5eed96dc authored by Wim Taymans's avatar Wim Taymans
Browse files

playbin2: clear the target

Clear the target of our ghostpads before we remove the pad from the element.
This to make sure that the internal pad is not left linked to whatever pad we
were ghosted to. This should only be a problem when we leak the ghostpads.

Also release our subpicture pads.

Fixes #577288.
parent 77050a72
......@@ -2229,6 +2229,7 @@ void
gst_play_sink_release_pad (GstPlaySink * playsink, GstPad * pad)
GstPad **res = NULL;
gboolean untarget = TRUE;
GST_DEBUG_OBJECT (playsink, "release pad %" GST_PTR_FORMAT, pad);
......@@ -2239,15 +2240,22 @@ gst_play_sink_release_pad (GstPlaySink * playsink, GstPad * pad)
res = &playsink->audio_pad;
} else if (pad == playsink->text_pad) {
res = &playsink->text_pad;
} else if (pad == playsink->subp_pad) {
res = &playsink->subp_pad;
} else {
/* try to release the given pad anyway, these could be the FLUSHING pads. */
res = &pad;
untarget = FALSE;
if (*res) {
GST_DEBUG_OBJECT (playsink, "deactivate pad %" GST_PTR_FORMAT, *res);
gst_pad_set_active (*res, FALSE);
if (untarget) {
GST_DEBUG_OBJECT (playsink, "untargeting pad %" GST_PTR_FORMAT, *res);
gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (*res), NULL);
GST_DEBUG_OBJECT (playsink, "remove pad %" GST_PTR_FORMAT, *res);
gst_element_remove_pad (GST_ELEMENT_CAST (playsink), *res);
*res = NULL;
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