Because of the new pad caching system, the peer pad might still
have a reference on a pad. We therefore delay the refcount checking
til 'after' we unlink the pad from any potential peer.
/* clean up floating src pad */
pad_element = gst_element_get_static_pad (element, name);
- ASSERT_OBJECT_REFCOUNT (pad_element, "pad", 2);
+ /* We don't check the refcount here since there *might* be
+ * a pad cache holding an extra reference on pad_element.
+ * To get to a state where no pad cache will exist,
+ * we first unlink that pad. */
pad_peer = gst_pad_get_peer (pad_element);
if (pad_peer) {