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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7888>
This commit is contained in:
Sebastian Dröge 2024-11-14 15:58:58 +02:00 committed by GStreamer Marge Bot
parent da02191411
commit dce0cdf548

View file

@ -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)) {