Skip to content

Commit

Permalink
Fix unintendend jump-cuts in auto DJ
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
daschuer committed Mar 5, 2022
1 parent 67c6a9a commit 5944fd8
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/library/autodj/autodjprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5944fd8

Please sign in to comment.