Skip to content

Commit

Permalink
Don't exceed intro end if outro is longer than adjusted intro
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Jun 5, 2023
1 parent 1d01463 commit c03d885
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/library/autodj/autodjprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit c03d885

Please sign in to comment.