From fad0a72eca51a340dd37f9de986c072f5707afae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 21 Jul 2022 16:10:18 +0300 Subject: [PATCH] audiobuffersplit: Use input running time for comparison instead of the currently tracked running time Otherwise gapless mode would do completely wrong calculations on discontinuities and cause input/output to drift slowly. Part-of: --- .../gst/audiobuffersplit/gstaudiobuffersplit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/audiobuffersplit/gstaudiobuffersplit.c b/subprojects/gst-plugins-bad/gst/audiobuffersplit/gstaudiobuffersplit.c index 1d0b03e7e1..32c8a2799c 100644 --- a/subprojects/gst-plugins-bad/gst/audiobuffersplit/gstaudiobuffersplit.c +++ b/subprojects/gst-plugins-bad/gst/audiobuffersplit/gstaudiobuffersplit.c @@ -549,14 +549,14 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self, GST_TIME_ARGS (current_rt_end), GST_TIME_ARGS (input_rt)); new_offset = - gst_util_uint64_scale (current_rt - self->resync_rt, + gst_util_uint64_scale (input_rt - self->resync_rt, rate * ABS (self->in_segment.rate), GST_SECOND); - if (current_rt < self->resync_rt) { + if (input_rt < self->resync_rt) { guint64 drop_samples; new_offset = gst_util_uint64_scale (self->resync_rt - - current_rt, rate * ABS (self->in_segment.rate), GST_SECOND); + input_rt, rate * ABS (self->in_segment.rate), GST_SECOND); drop_samples = self->current_offset + avail_samples + new_offset; GST_DEBUG_OBJECT (self,