gst/gstpad.c: While checking the flag for reentrancy in the gstcaps function is nice...
authorWim Taymans <wim.taymans@gmail.com>
Fri, 11 Nov 2005 16:34:15 +0000 (16:34 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 11 Nov 2005 16:34:15 +0000 (16:34 +0000)
Original commit message from CVS:
* gst/gstpad.c: (gst_pad_get_caps), (gst_pad_peer_get_caps):
While checking the flag for reentrancy in the gstcaps function
is nice to detect recursive invocations, it also makes it
impossible to call getcaps from multiple threads, which must be
possible. So, checking for recursive calls has to go.

ChangeLog
gst/gstpad.c

index 371201a..36285c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-11-11  Wim Taymans  <wim@fluendo.com>
+
+       * gst/gstpad.c: (gst_pad_get_caps), (gst_pad_peer_get_caps):
+       While checking the flag for reentrancy in the gstcaps function
+       is nice to detect recursive invocations, it also makes it 
+       impossible to call getcaps from multiple threads, which must be
+       possible. So, checking for recursive calls has to go.
+
 2005-11-11  Michael Smith <msmith@fluendo.com>
 
        * gst/base/gstbasesink.c: (gst_base_sink_do_sync):
index de6fbf4..17bbd5f 100644 (file)
@@ -1849,23 +1849,10 @@ gst_pad_get_caps (GstPad * pad)
   GST_CAT_DEBUG (GST_CAT_CAPS, "get pad caps of %s:%s (%p)",
       GST_DEBUG_PAD_NAME (pad), pad);
 
-  if (G_UNLIKELY (GST_PAD_IS_IN_GETCAPS (pad)))
-    goto was_dispatching;
-
   result = gst_pad_get_caps_unlocked (pad);
   GST_UNLOCK (pad);
 
   return result;
-
-was_dispatching:
-  {
-    GST_CAT_DEBUG (GST_CAT_CAPS,
-        "pad %s:%s is already dispatching!", GST_DEBUG_PAD_NAME (pad));
-    g_warning ("pad %s:%s recursively called getcaps!",
-        GST_DEBUG_PAD_NAME (pad));
-    GST_UNLOCK (pad);
-    return NULL;
-  }
 }
 
 /**
@@ -1876,7 +1863,7 @@ was_dispatching:
  *
  * Returns: the #GstCaps of the peer pad. This function returns a new caps, so use
  * gst_caps_unref to get rid of it. this function returns NULL if there is no
- * peer pad or when this function is called recursively from a getcaps function.
+ * peer pad.
  */
 GstCaps *
 gst_pad_peer_get_caps (GstPad * pad)
@@ -1895,9 +1882,6 @@ gst_pad_peer_get_caps (GstPad * pad)
   if (G_UNLIKELY (peerpad == NULL))
     goto no_peer;
 
-  if (G_UNLIKELY (GST_PAD_IS_IN_GETCAPS (peerpad)))
-    goto was_dispatching;
-
   gst_object_ref (peerpad);
   GST_UNLOCK (pad);
 
@@ -1912,15 +1896,6 @@ no_peer:
     GST_UNLOCK (pad);
     return NULL;
   }
-was_dispatching:
-  {
-    GST_CAT_DEBUG (GST_CAT_CAPS,
-        "pad %s:%s is already dispatching!", GST_DEBUG_PAD_NAME (pad));
-    g_warning ("pad %s:%s recursively called getcaps!",
-        GST_DEBUG_PAD_NAME (pad));
-    GST_UNLOCK (pad);
-    return NULL;
-  }
 }
 
 static gboolean