mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
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.
This commit is contained in:
parent
6b2425e5a4
commit
e39c2beaae
2 changed files with 9 additions and 26 deletions
|
@ -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):
|
||||
|
|
27
gst/gstpad.c
27
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
|
||||
|
|
Loading…
Reference in a new issue