From 5944fd846f8f71c49bf59778387851444f866b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 4 Mar 2022 21:57:44 +0100 Subject: [PATCH] Fix unintendend jump-cuts in auto DJ This happened because the track is not able to seek exactly to the intro start point. In this case taking the start point as end point does not lead to a zero length intro. --- src/library/autodj/autodjprocessor.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/library/autodj/autodjprocessor.cpp b/src/library/autodj/autodjprocessor.cpp index aee5370c652..4efd3dc55da 100644 --- a/src/library/autodj/autodjprocessor.cpp +++ b/src/library/autodj/autodjprocessor.cpp @@ -1163,8 +1163,6 @@ void AutoDJProcessor::calculateTransition(DeckAttributes* pFromDeck, return; } - qDebug() << "player" << pFromDeck->group << "calculateTransition()"; - const double fromDeckEndPosition = getEndSecond(pFromDeck); const double toDeckEndPosition = getEndSecond(pToDeck); // Since the end position is measured in seconds from 0:00 it is also @@ -1227,16 +1225,15 @@ void AutoDJProcessor::calculateTransition(DeckAttributes* pFromDeck, introStart = toDeckPositionSeconds; } - double introEnd = getIntroEndSecond(pToDeck); - if (introEnd < introStart) { - // introEnd is invalid. Assume a zero length intro. - // The introStart is automatically placed by AnalyzerSilence, so use - // that as a fallback if the user has not placed introEnd. - introEnd = introStart; + double introLength = 0; + const double introEndSample = pToDeck->introEndPosition(); + if (introEndSample != Cue::kNoPosition) { + const double introEnd = samplePositionToSeconds(introEndSample, pToDeck); + if (introStart < introEnd) { + introLength = introEnd - introStart; + } } - double introLength = introEnd - introStart; - if (sDebug) { qDebug() << this << "calculateTransition" << "introLength" << introLength