aggregator: Document locking for gst_aggregator_get_latency_unlocked()
authorOlivier Crête <olivier.crete@collabora.com>
Thu, 22 Jan 2015 00:43:12 +0000 (19:43 -0500)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 2 Dec 2017 15:10:26 +0000 (15:10 +0000)
Renamed it to _unlocked() to make it clear.

https://bugzilla.gnome.org/show_bug.cgi?id=742684

libs/gst/base/gstaggregator.c
libs/gst/base/gstaggregator.h

index a225310..73a655f 100644 (file)
@@ -524,7 +524,9 @@ gst_aggregator_wait_and_check (GstAggregator * self, gboolean * timeout)
 
   SRC_STREAM_LOCK (self);
 
-  gst_aggregator_get_latency (self, &live, &latency_min, &latency_max);
+  GST_OBJECT_LOCK (self);
+  gst_aggregator_get_latency_unlocked (self, &live, &latency_min, &latency_max);
+  GST_OBJECT_UNLOCK (self);
 
   if (gst_aggregator_check_pads_ready (self)) {
     GST_DEBUG_OBJECT (self, "all pads have data");
@@ -1111,7 +1113,7 @@ gst_aggregator_query_sink_latency_foreach (GstAggregator * self,
 }
 
 /**
- * gst_aggregator_get_latency:
+ * gst_aggregator_get_latency_unlocked:
  * @self: a #GstAggregator
  * @live: (out) (allow-none): whether @self is live
  * @min_latency: (out) (allow-none): the configured minimum latency of @self
@@ -1121,9 +1123,11 @@ gst_aggregator_query_sink_latency_foreach (GstAggregator * self,
  * query.
  *
  * Typically only called by subclasses.
+ *
+ * MUST be called with the object lock held.
  */
 void
-gst_aggregator_get_latency (GstAggregator * self, gboolean * live,
+gst_aggregator_get_latency_unlocked (GstAggregator * self, gboolean * live,
     GstClockTime * min_latency, GstClockTime * max_latency)
 {
   GstClockTime our_latency;
index a4ede1d..636e84e 100644 (file)
@@ -271,7 +271,7 @@ gboolean gst_aggregator_iterate_sinkpads           (GstAggregator
                                                     GstAggregatorPadForeachFunc      func,
                                                     gpointer                         user_data);
 
-void     gst_aggregator_get_latency                (GstAggregator                 *  self,
+void     gst_aggregator_get_latency_unlocked       (GstAggregator                 *  self,
                                                     gboolean                      *  live,
                                                     GstClockTime                  *  min,
                                                     GstClockTime                  *  max);