From 3eb52b293e8b99c2a70d33d47ed40d7ac84f4ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 18 Sep 2015 18:00:05 +0200 Subject: [PATCH] audioaggregator: Only skip the remaining part of a GAP buffer We might've queued up a GAP buffer that is only partially inside the current output buffer (i.e. we received it too late!). In that case we should only skip the part of the GAP buffer that is inside the current output buffer, not also the remaining part. Otherwise we forward this pad too far into the future and break synchronization. --- gst/audiomixer/gstaudioaggregator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audiomixer/gstaudioaggregator.c b/gst/audiomixer/gstaudioaggregator.c index 1d3dcb56b4..156fa93626 100644 --- a/gst/audiomixer/gstaudioaggregator.c +++ b/gst/audiomixer/gstaudioaggregator.c @@ -976,7 +976,7 @@ gst_audio_aggregator_mix_buffer (GstAudioAggregator * aagg, if (GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_GAP)) { /* skip gap buffer */ GST_LOG_OBJECT (pad, "skipping GAP buffer"); - pad->priv->output_offset += pad->priv->size; + pad->priv->output_offset += pad->priv->size - pad->priv->position; pad->priv->position = pad->priv->size; gst_buffer_replace (&pad->priv->buffer, NULL);