aggregator: Make sure that the minimum latencies are never GST_CLOCK_TIME_NONE
authorSebastian Dröge <sebastian@centricular.com>
Sat, 27 Dec 2014 08:49:43 +0000 (09:49 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 2 Dec 2017 15:10:26 +0000 (15:10 +0000)
libs/gst/base/gstaggregator.c

index bb8924e..9ab31c1 100644 (file)
@@ -1013,7 +1013,7 @@ _latency_query (GstAggregator * self, GstPad * pad, gpointer user_data)
         " max:%" G_GINT64_FORMAT, GST_PAD_NAME (pad),
         live ? "true" : "false", min, max);
 
-    if (min > data->min)
+    if (min != GST_CLOCK_TIME_NONE && min > data->min)
       data->min = min;
 
     if (max != GST_CLOCK_TIME_NONE &&
@@ -1049,6 +1049,7 @@ gst_aggregator_get_latency (GstAggregator * self, gboolean * live,
 
   g_return_if_fail (GST_IS_AGGREGATOR (self));
 
+  /* latency_min is never GST_CLOCK_TIME_NONE by construction */
   min = self->priv->latency_min;
   max = self->priv->latency_max;
 
@@ -1990,6 +1991,7 @@ gst_aggregator_set_latency (GstAggregator * self,
     GstClockTime min_latency, GstClockTime max_latency)
 {
   g_return_if_fail (GST_IS_AGGREGATOR (self));
+  g_return_if_fail (GST_CLOCK_TIME_IS_VALID (min_latency));
   g_return_if_fail (max_latency >= min_latency);
 
   GST_OBJECT_LOCK (self);