From dce0cdf5482797d87f809b2844eee6e4b0ef01b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 14 Nov 2024 15:58:58 +0200 Subject: [PATCH] audiostreamalign: Don't report disconts for every buffer if alignment-threshold is too small If it is too small, the maximum allowed diff becomes 0 samples which would then trigger if there is no discontinuity at all. Part-of: --- .../gst-plugins-base/gst-libs/gst/audio/gstaudiostreamalign.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudiostreamalign.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudiostreamalign.c index 89d9881069..adcad52156 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudiostreamalign.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudiostreamalign.c @@ -383,9 +383,9 @@ gst_audio_stream_align_process (GstAudioStreamAlign * align, gst_util_uint64_scale (align->next_offset, GST_SECOND, ABS (align->rate)); - max_sample_diff = + max_sample_diff = MAX (1, gst_util_uint64_scale_int (align->alignment_threshold, - ABS (align->rate), GST_SECOND); + ABS (align->rate), GST_SECOND)); /* Discont! */ if (G_UNLIKELY (diff >= max_sample_diff)) {