diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-06-19 00:05:44 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-07-03 12:56:01 -0400 |
commit | f126094dce3539c94b3a50dfc9622143a1ba2649 (patch) | |
tree | 54fb49b610e16340a4d8afc923c216f0cdf52d5a /gst | |
parent | bd9c526661b191a2e2bae3405653f5a582bfaf9e (diff) |
pad: Enforce NEED_PARENT flag also for chain
The check for the presence of the parent in the presence of
the NEED_PARENT flag was missing for the chain function. Also keep
a ref on the parent in case the pad is removed mid-chain.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gstpad.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c index c4e8ff25f..34735a0bb 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -4017,7 +4017,7 @@ gst_pad_chain_data_unchecked (GstPad * pad, GstPadProbeType type, void *data) PROBE_PUSH (pad, type, data, probe_stopped); - parent = GST_OBJECT_PARENT (pad); + ACQUIRE_PARENT (pad, parent, no_parent); GST_OBJECT_UNLOCK (pad); /* NOTE: we read the chainfunc unlocked. @@ -4057,6 +4057,8 @@ gst_pad_chain_data_unchecked (GstPad * pad, GstPadProbeType type, void *data) GST_DEBUG_FUNCPTR_NAME (chainlistfunc), gst_flow_get_name (ret)); } + RELEASE_PARENT (parent); + GST_PAD_STREAM_UNLOCK (pad); return ret; @@ -4105,8 +4107,17 @@ probe_stopped: } return ret; } +no_parent: + { + GST_DEBUG_OBJECT (pad, "No parent when chaining %" GST_PTR_FORMAT, data); + gst_mini_object_unref (GST_MINI_OBJECT_CAST (data)); + GST_OBJECT_UNLOCK (pad); + GST_PAD_STREAM_UNLOCK (pad); + return GST_FLOW_FLUSHING; + } no_function: { + RELEASE_PARENT (parent); gst_mini_object_unref (GST_MINI_OBJECT_CAST (data)); g_critical ("chain on pad %s:%s but it has no chainfunction", GST_DEBUG_PAD_NAME (pad)); |