From: Wim Taymans Date: Fri, 11 Nov 2005 16:34:15 +0000 (+0000) Subject: gst/gstpad.c: While checking the flag for reentrancy in the gstcaps function is nice... X-Git-Tag: RELEASE-0_9_5~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e39c2beaae2daf619ac8a553018d2f8265fa2eb9;p=platform%2Fupstream%2Fgstreamer.git gst/gstpad.c: While checking the flag for reentrancy in the gstcaps function is nice to detect recursive invocations,... 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. --- diff --git a/ChangeLog b/ChangeLog index 371201a..36285c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-11-11 Wim Taymans + + * 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 * gst/base/gstbasesink.c: (gst_base_sink_do_sync): diff --git a/gst/gstpad.c b/gst/gstpad.c index de6fbf4..17bbd5f 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -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