mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-15 13:53:19 +00:00
pad: take stream lock on serialized queries
This commit is contained in:
parent
cd6693fdc9
commit
fb2fc331de
1 changed files with 16 additions and 1 deletions
17
gst/gstpad.c
17
gst/gstpad.c
|
@ -3122,7 +3122,7 @@ gboolean
|
|||
gst_pad_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstObject *parent;
|
||||
gboolean res;
|
||||
gboolean res, serialized;
|
||||
GstPadQueryFunction func;
|
||||
GstPadProbeType type;
|
||||
GstFlowReturn ret;
|
||||
|
@ -3144,6 +3144,10 @@ gst_pad_query (GstPad * pad, GstQuery * query)
|
|||
GST_DEBUG_OBJECT (pad, "doing query %p (%s)", query,
|
||||
GST_QUERY_TYPE_NAME (query));
|
||||
|
||||
serialized = GST_QUERY_IS_SERIALIZED (query);
|
||||
if (G_UNLIKELY (serialized))
|
||||
GST_PAD_STREAM_LOCK (pad);
|
||||
|
||||
GST_OBJECT_LOCK (pad);
|
||||
PROBE_PUSH (pad, type | GST_PAD_PROBE_TYPE_PUSH |
|
||||
GST_PAD_PROBE_TYPE_BLOCK, query, probe_stopped);
|
||||
|
@ -3169,6 +3173,9 @@ gst_pad_query (GstPad * pad, GstQuery * query)
|
|||
PROBE_PUSH (pad, type | GST_PAD_PROBE_TYPE_PULL, query, probe_stopped);
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
if (G_UNLIKELY (serialized))
|
||||
GST_PAD_STREAM_UNLOCK (pad);
|
||||
|
||||
return res;
|
||||
|
||||
/* ERRORS */
|
||||
|
@ -3187,23 +3194,31 @@ no_parent:
|
|||
{
|
||||
GST_DEBUG_OBJECT (pad, "had no parent");
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
if (G_UNLIKELY (serialized))
|
||||
GST_PAD_STREAM_UNLOCK (pad);
|
||||
return FALSE;
|
||||
}
|
||||
no_func:
|
||||
{
|
||||
GST_DEBUG_OBJECT (pad, "had no query function");
|
||||
RELEASE_PARENT (parent);
|
||||
if (G_UNLIKELY (serialized))
|
||||
GST_PAD_STREAM_UNLOCK (pad);
|
||||
return FALSE;
|
||||
}
|
||||
query_failed:
|
||||
{
|
||||
GST_DEBUG_OBJECT (pad, "query failed");
|
||||
if (G_UNLIKELY (serialized))
|
||||
GST_PAD_STREAM_UNLOCK (pad);
|
||||
return FALSE;
|
||||
}
|
||||
probe_stopped:
|
||||
{
|
||||
GST_DEBUG_OBJECT (pad, "probe stopped: %s", gst_flow_get_name (ret));
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
if (G_UNLIKELY (serialized))
|
||||
GST_PAD_STREAM_UNLOCK (pad);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue