From c03d885e975d342f38dae22efde7b2cd21d5a3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Mon, 5 Jun 2023 11:00:48 +0200 Subject: [PATCH] Don't exceed intro end if outro is longer than adjusted intro --- src/library/autodj/autodjprocessor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/library/autodj/autodjprocessor.cpp b/src/library/autodj/autodjprocessor.cpp index cb367fac88f..94880ab2088 100644 --- a/src/library/autodj/autodjprocessor.cpp +++ b/src/library/autodj/autodjprocessor.cpp @@ -1281,13 +1281,13 @@ void AutoDJProcessor::calculateTransition(DeckAttributes* pFromDeck, // introEnd is equal introStart in case it has not yet been set if (toDeckStartSeconds < introEnd && introStart < introEnd) { - // Limit the intro length adjustments to the original length x 2 - // or original length + transition time, whichever is longer. - double seekBack = introStart - toDeckStartSeconds; - if (seekBack <= 0 || - seekBack <= m_transitionTime || - seekBack <= introEnd - introStart) { - introLength = introEnd - toDeckStartSeconds; + // Limit the intro length that results from a revers seek + // to a reasonable values. If the seek was too big, ignore it. + introLength = introEnd - toDeckStartSeconds; + if (introLength > (introEnd - introStart) * 2 && + introLength > (introEnd - introStart) + m_transitionTime && + introLength > outroLength) { + introLength = 0; } }