From 07d9bf9cab1546a4b19ba4593bb2b29d9f9bb56e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 6 Feb 2015 10:36:28 +0100 Subject: [PATCH 1/1] aggregator: If upstream has no max latency but the subclass has, take the subclass max latency --- libs/gst/base/gstaggregator.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index 9f29bec..5fe1913 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -1163,8 +1163,8 @@ gst_aggregator_get_latency_unlocked (GstAggregator * self, gboolean * live, max += self->priv->sub_latency_max; our_latency = self->priv->latency; - if (GST_CLOCK_TIME_IS_VALID (our_latency)) - min += our_latency; + else if (GST_CLOCK_TIME_IS_VALID (self->priv->sub_latency_max)) + max = self->priv->sub_latency_max; if (live) *live = self->priv->latency_live; @@ -1221,6 +1221,8 @@ gst_aggregator_query_latency (GstAggregator * self, GstQuery * query) if (GST_CLOCK_TIME_IS_VALID (self->priv->sub_latency_max) && GST_CLOCK_TIME_IS_VALID (data.max)) data.max += self->priv->sub_latency_max; + else if (GST_CLOCK_TIME_IS_VALID (self->priv->sub_latency_max)) + data.max = self->priv->sub_latency_max; if (data.live && GST_CLOCK_TIME_IS_VALID (our_latency) && data.min > data.max) { GST_ELEMENT_WARNING (self, CORE, NEGOTIATION, -- 2.7.4