GstPad: relax failure to deactivate unlinked pads

When de/activating a pad in pull mode the pad needs to de/activate the
peer pad it is connected to, failure to be able to do this in activation mode
is an error.

However if there is no peerpad, we can still deactivate the pad correctly and
assume the application will deactivate the unlinked peer pad eventually.

Fixes #574163.
This commit is contained in:
Antoine Tremblay 2009-03-05 11:29:48 +01:00 committed by Wim Taymans
parent e13168bd4b
commit fe2f12b162

View file

@ -767,7 +767,13 @@ gst_pad_activate_pull (GstPad * pad, gboolean active)
goto peer_failed;
gst_object_unref (peer);
} else {
goto not_linked;
/* there is no peer, this is only fatal when we activate. When we
* deactivate, we must assume the application has unlinked the peer and
* will deactivate it eventually. */
if (active)
goto not_linked;
else
GST_DEBUG_OBJECT (pad, "deactivating unlinked pad");
}
} else {
if (G_UNLIKELY (GST_PAD_GETRANGEFUNC (pad) == NULL))