mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
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.
This commit is contained in:
parent
77050a72f8
commit
5eed96dc06
1 changed files with 8 additions and 0 deletions
|
@ -2229,6 +2229,7 @@ void
|
||||||
gst_play_sink_release_pad (GstPlaySink * playsink, GstPad * pad)
|
gst_play_sink_release_pad (GstPlaySink * playsink, GstPad * pad)
|
||||||
{
|
{
|
||||||
GstPad **res = NULL;
|
GstPad **res = NULL;
|
||||||
|
gboolean untarget = TRUE;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (playsink, "release pad %" GST_PTR_FORMAT, pad);
|
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;
|
res = &playsink->audio_pad;
|
||||||
} else if (pad == playsink->text_pad) {
|
} else if (pad == playsink->text_pad) {
|
||||||
res = &playsink->text_pad;
|
res = &playsink->text_pad;
|
||||||
|
} else if (pad == playsink->subp_pad) {
|
||||||
|
res = &playsink->subp_pad;
|
||||||
} else {
|
} else {
|
||||||
/* try to release the given pad anyway, these could be the FLUSHING pads. */
|
/* try to release the given pad anyway, these could be the FLUSHING pads. */
|
||||||
res = &pad;
|
res = &pad;
|
||||||
|
untarget = FALSE;
|
||||||
}
|
}
|
||||||
GST_PLAY_SINK_UNLOCK (playsink);
|
GST_PLAY_SINK_UNLOCK (playsink);
|
||||||
|
|
||||||
if (*res) {
|
if (*res) {
|
||||||
GST_DEBUG_OBJECT (playsink, "deactivate pad %" GST_PTR_FORMAT, *res);
|
GST_DEBUG_OBJECT (playsink, "deactivate pad %" GST_PTR_FORMAT, *res);
|
||||||
gst_pad_set_active (*res, FALSE);
|
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_DEBUG_OBJECT (playsink, "remove pad %" GST_PTR_FORMAT, *res);
|
||||||
gst_element_remove_pad (GST_ELEMENT_CAST (playsink), *res);
|
gst_element_remove_pad (GST_ELEMENT_CAST (playsink), *res);
|
||||||
*res = NULL;
|
*res = NULL;
|
||||||
|
|
Loading…
Reference in a new issue