diff options
author | Olivier Crête <olivier.crete@collabora.com> | 2017-07-13 19:03:19 -0400 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2017-12-02 15:10:27 +0000 |
commit | 3d0dad59a0db3ac13a7e1e025a841bb5fa53cad8 (patch) | |
tree | 070a74e702e9bafb446cb49055d4013bb5a4de26 | |
parent | 8b60b25917c224b95afa0f05792560c5bee46eac (diff) |
aggregator: Don't take flush lock from output thread
Instead just take it in the chain function.
https://bugzilla.gnome.org/show_bug.cgi?id=784911
-rw-r--r-- | libs/gst/base/gstaggregator.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index 3a642d8a6..67d8a7075 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -2467,6 +2467,12 @@ apply_buffer (GstAggregatorPad * aggpad, GstBuffer * buffer, gboolean head) update_time_level (aggpad, head); } +/* + * Can be called either from the sinkpad's chain function or from the srcpad's + * thread in the case of a buffer synthetized from a GAP event. + * Because of this second case, FLUSH_LOCK can't be used here. + */ + static GstFlowReturn gst_aggregator_pad_chain_internal (GstAggregator * self, GstAggregatorPad * aggpad, GstBuffer * buffer, gboolean head) @@ -2476,8 +2482,6 @@ gst_aggregator_pad_chain_internal (GstAggregator * self, GST_DEBUG_OBJECT (aggpad, "Start chaining a buffer %" GST_PTR_FORMAT, buffer); - PAD_FLUSH_LOCK (aggpad); - PAD_LOCK (aggpad); flow_return = aggpad->priv->flow_return; if (flow_return != GST_FLOW_OK) @@ -2573,15 +2577,12 @@ gst_aggregator_pad_chain_internal (GstAggregator * self, GST_OBJECT_UNLOCK (self); SRC_UNLOCK (self); - PAD_FLUSH_UNLOCK (aggpad); - GST_DEBUG_OBJECT (aggpad, "Done chaining"); return flow_return; flushing: PAD_UNLOCK (aggpad); - PAD_FLUSH_UNLOCK (aggpad); GST_DEBUG_OBJECT (aggpad, "Pad is %s, dropping buffer", gst_flow_get_name (flow_return)); @@ -2594,8 +2595,17 @@ flushing: static GstFlowReturn gst_aggregator_pad_chain (GstPad * pad, GstObject * object, GstBuffer * buffer) { - return gst_aggregator_pad_chain_internal (GST_AGGREGATOR_CAST (object), - GST_AGGREGATOR_PAD_CAST (pad), buffer, TRUE); + GstFlowReturn ret; + GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad); + + PAD_FLUSH_LOCK (aggpad); + + ret = gst_aggregator_pad_chain_internal (GST_AGGREGATOR_CAST (object), + aggpad, buffer, TRUE); + + PAD_FLUSH_UNLOCK (aggpad); + + return ret; } static gboolean |