diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-07-02 11:21:27 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2020-09-24 18:40:53 +0300 |
commit | d0eb870c1463e4d71d430f9602ce84da32f7defc (patch) | |
tree | e7cc3a3c58d6a419b6a33e14e080096fb6f7c444 | |
parent | c33f859aa0cc411613c6ac7c63b413b2efde7fea (diff) |
element: When removing a ghost pad also unset its target
Otherwise the proxy pad of the ghost pad still stays linked to some
element inside the bin, which is not allowed anymore according to the
topology.
In 2.0 this should be fixed more generically from inside GstGhostPad but
currently there is no way to get notified that the ghost pad is
unparented.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/642>
-rw-r--r-- | gst/gstelement.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gst/gstelement.c b/gst/gstelement.c index b34608570e..f055e3ec24 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -88,6 +88,7 @@ #include "gstbus.h" #include "gsterror.h" #include "gstevent.h" +#include "gstghostpad.h" #include "gstutils.h" #include "gstinfo.h" #include "gstquark.h" @@ -803,6 +804,16 @@ gst_element_remove_pad (GstElement * element, GstPad * pad) gst_object_unref (peer); } + /* if this is a ghost pad we also need to unset the target or it + * will stay linked although not allowed according to the topology. + * + * FIXME 2.0: Do this generically somehow from inside GstGhostPad + * when it gets unparented. + */ + if (GST_IS_GHOST_PAD (pad)) { + gst_ghost_pad_set_target (GST_GHOST_PAD (pad), NULL); + } + GST_OBJECT_LOCK (element); /* remove it from the list */ switch (gst_pad_get_direction (pad)) { |