audioaggregator: Print a message when a buffer is late

https://bugzilla.gnome.org/show_bug.cgi?id=740236
This commit is contained in:
Olivier Crête 2015-03-06 16:51:12 -05:00
parent 01520c7e47
commit c565877991

View file

@ -1143,6 +1143,7 @@ gst_audio_aggregator_aggregate (GstAggregator * agg, gboolean timeout)
* and maybe drop the current buffer */ * and maybe drop the current buffer */
if (pad->priv->output_offset < aagg->priv->offset) { if (pad->priv->output_offset < aagg->priv->offset) {
gint64 diff = aagg->priv->offset - pad->priv->output_offset; gint64 diff = aagg->priv->offset - pad->priv->output_offset;
gint64 odiff = diff;
if (pad->priv->position + diff > pad->priv->size) if (pad->priv->position + diff > pad->priv->size)
diff = pad->priv->size - pad->priv->position; diff = pad->priv->size - pad->priv->position;
@ -1150,6 +1151,10 @@ gst_audio_aggregator_aggregate (GstAggregator * agg, gboolean timeout)
pad->priv->output_offset += diff; pad->priv->output_offset += diff;
if (pad->priv->position == pad->priv->size) { if (pad->priv->position == pad->priv->size) {
GST_LOG_OBJECT (pad, "Buffer was late by %" GST_TIME_FORMAT
", dropping %" GST_PTR_FORMAT,
GST_TIME_ARGS (gst_util_uint64_scale (odiff, GST_SECOND,
GST_AUDIO_INFO_RATE (&aagg->info))), pad->priv->buffer);
/* Buffer done, drop it */ /* Buffer done, drop it */
gst_buffer_replace (&pad->priv->buffer, NULL); gst_buffer_replace (&pad->priv->buffer, NULL);
dropped = TRUE; dropped = TRUE;