From: Olivier CrĂȘte Date: Sun, 15 May 2016 13:04:58 +0000 (+0300) Subject: aggregator: Only declare first buffer on actual buffer X-Git-Tag: 1.19.3~507^2~5226 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20aee5f5757e2b000d8e55bd1fb5386548526749;p=platform%2Fupstream%2Fgstreamer.git aggregator: Only declare first buffer on actual buffer The function needs to be unlocked if any data is received, but only end the first buffer processing on an actual buffer, synchronized events don't matter on the first buffer processing. https://bugzilla.gnome.org/show_bug.cgi?id=781673 --- diff --git a/gst-libs/gst/base/gstaggregator.c b/gst-libs/gst/base/gstaggregator.c index cd146fd..88b71bc 100644 --- a/gst-libs/gst/base/gstaggregator.c +++ b/gst-libs/gst/base/gstaggregator.c @@ -426,7 +426,8 @@ gst_aggregator_check_pads_ready (GstAggregator * self) { GstAggregatorPad *pad; GList *l, *sinkpads; - gboolean have_data = TRUE; + gboolean have_buffer = TRUE; + gboolean have_event = FALSE; GST_LOG_OBJECT (self, "checking pads"); @@ -441,9 +442,11 @@ gst_aggregator_check_pads_ready (GstAggregator * self) PAD_LOCK (pad); - if (gst_aggregator_pad_queue_is_empty (pad)) { + if (pad->priv->num_buffers == 0) { + if (!gst_aggregator_pad_queue_is_empty (pad)) + have_event = TRUE; if (!pad->priv->eos) { - have_data = FALSE; + have_buffer = FALSE; /* If not live we need data on all pads, so leave the loop */ if (!self->priv->peer_latency_live) { @@ -462,10 +465,11 @@ gst_aggregator_check_pads_ready (GstAggregator * self) PAD_UNLOCK (pad); } - if (!have_data) + if (!have_buffer && !have_event) goto pad_not_ready; - self->priv->first_buffer = FALSE; + if (have_buffer) + self->priv->first_buffer = FALSE; GST_OBJECT_UNLOCK (self); GST_LOG_OBJECT (self, "pads are ready"); @@ -479,9 +483,13 @@ no_sinkpads: } pad_not_ready: { - GST_LOG_OBJECT (pad, "pad not ready to be aggregated yet"); + if (have_event) + GST_LOG_OBJECT (pad, "pad not ready to be aggregated yet," + " but waking up for serialized event"); + else + GST_LOG_OBJECT (pad, "pad not ready to be aggregated yet"); GST_OBJECT_UNLOCK (self); - return FALSE; + return have_event; } }