/* called with the src STREAM lock */
static gboolean
-_wait_and_check (GstAggregator * self)
+_wait_and_check (GstAggregator * self, gboolean * timeout)
{
GstClockTime latency_max, latency_min;
GstClockTime start;
gboolean live;
+ *timeout = FALSE;
+
gst_aggregator_get_latency (self, &live, &latency_min, &latency_max);
if (gst_aggregator_iterate_sinkpads (self,
/* we timed out */
if (status == GST_CLOCK_OK || status == GST_CLOCK_EARLY) {
SRC_STREAM_UNLOCK (self);
+ *timeout = TRUE;
return TRUE;
}
}
{
GstAggregatorPrivate *priv = self->priv;
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (self);
+ gboolean timeout = FALSE;
if (self->priv->running == FALSE) {
GST_DEBUG_OBJECT (self, "Not running anymore");
GST_LOG_OBJECT (self, "Checking aggregate");
while (priv->send_eos && priv->running) {
- if (!_wait_and_check (self))
+ if (!_wait_and_check (self, &timeout))
continue;
GST_TRACE_OBJECT (self, "Actually aggregating!");
- priv->flow_return = klass->aggregate (self);
+ priv->flow_return = klass->aggregate (self, timeout);
if (priv->flow_return == GST_FLOW_EOS) {
_push_eos (self);