aggregator: Be more aggressive with invalid replies to our latency query

https://bugzilla.gnome.org/show_bug.cgi?id=745768
This commit is contained in:
Olivier Crête 2015-03-06 21:12:13 -05:00 committed by Tim-Philipp Müller
parent 87b25fb7a5
commit 46e33e84fd

View file

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