aggregator: fix input buffering

We need to be able to buffer at least the aggregator latency +
upstream latency, which is the value used to compute the aggregator
deadline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3138>
This commit is contained in:
Guillaume Desmottes 2022-10-07 14:39:47 +02:00
parent 56eb44c502
commit 2df2dfce55

View file

@ -3007,14 +3007,14 @@ gst_aggregator_pad_has_space (GstAggregator * self, GstAggregatorPad * aggpad)
if (self->priv->peer_latency_live && aggpad->priv->num_buffers < 2)
return TRUE;
/* zero latency, if there is a buffer, it's full */
if (self->priv->latency == 0)
return FALSE;
/* On top of our latency, we also want to allow buffering up to the
* minimum upstream latency to allow queue free sources with lower then
* upstream latency. */
max_time_level = self->priv->latency + self->priv->upstream_latency_min;
max_time_level = self->priv->latency + self->priv->peer_latency_min;
/* zero latency, if there is a buffer, it's full */
if (max_time_level == 0)
return FALSE;
GST_TRACE_OBJECT (aggpad, "Maximum queue level %" GST_TIME_FORMAT,
GST_TIME_ARGS (max_time_level));