aggregator: Be more aggressive with invalid replies to our latency query
authorOlivier Crête <olivier.crete@collabora.com>
Sat, 7 Mar 2015 02:12:13 +0000 (21:12 -0500)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 2 Dec 2017 15:10:26 +0000 (15:10 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=745768

libs/gst/base/gstaggregator.c

index c8d179c..788c84a 100644 (file)
@@ -1129,15 +1129,19 @@ gst_aggregator_query_latency (GstAggregator * self, GstQuery * query)
   our_latency = self->priv->latency;
 
   if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (min))) {
-    GST_WARNING_OBJECT (self, "Invalid minimum latency, using 0");
-    min = 0;
+    GST_ERROR_OBJECT (self, "Invalid minimum latency %" GST_TIME_FORMAT
+        ". Please file a bug at " PACKAGE_BUGREPORT ".", GST_TIME_ARGS (min));
+    SRC_UNLOCK (self);
+    return FALSE;
   }
 
-  if (G_UNLIKELY (min > max)) {
-    GST_WARNING_OBJECT (self, "Minimum latency is greater than maximum latency "
-        "(%" G_GINT64_FORMAT " > %" G_GINT64_FORMAT "). "
-        "Clamping it at the maximum latency", min, max);
-    min = max;
+  if (min > max && GST_CLOCK_TIME_IS_VALID (max)) {
+    GST_ELEMENT_WARNING (self, CORE, CLOCK, (NULL),
+        ("Impossible to configure latency: max %" GST_TIME_FORMAT " < min %"
+            GST_TIME_FORMAT ". Add queues or other buffering elements.",
+            GST_TIME_ARGS (max), GST_TIME_ARGS (min)));
+    SRC_UNLOCK (self);
+    return FALSE;
   }
 
   self->priv->latency_live = live;