- fix gst_element_unlink, only unlink pads that belong to the dest element. (closes bug #105571)

Original commit message from CVS:
- fix gst_element_unlink, only unlink pads that belong to the dest
element. (closes bug #105571)
This commit is contained in:
Wim Taymans 2003-02-11 20:28:29 +00:00
parent 48c70d75cb
commit 9e1ed8d760

View file

@ -1727,11 +1727,15 @@ gst_element_unlink (GstElement *src, GstElement *dest)
while (srcpads) {
pad = GST_PAD_CAST (srcpads->data);
if (GST_IS_REAL_PAD (pad) && GST_PAD_DIRECTION (pad) == GST_PAD_SRC) {
/* we only care about real src pads */
if (GST_IS_REAL_PAD (pad) && GST_PAD_IS_SRC (pad)) {
GstPad *peerpad = GST_PAD_PEER (pad);
if (peerpad &&
(GST_OBJECT_PARENT (GST_PAD_PEER (peerpad)) == (GstObject*) src)) {
/* see if the pad is connected and is really a pad
* of dest */
if (peerpad &&
(GST_OBJECT_PARENT (peerpad) == (GstObject*) dest))
{
gst_pad_unlink (pad, peerpad);
}
}