Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looping: fix asserts for loop move #11735

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/engine/controls/loopingcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1742,13 +1742,13 @@ mixxx::audio::FramePos LoopingControl::adjustedPositionInsideAdjustedLoop(
ceil((adjustedPosition.value() - newLoopEndPosition.value()) /
newLoopSize);
adjustedPosition -= adjustSteps * newLoopSize;
DEBUG_ASSERT(adjustedPosition <= newLoopEndPosition);
VERIFY_OR_DEBUG_ASSERT(adjustedPosition > newLoopStartPosition) {
// I'm not even sure this is possible. The new loop would have to be bigger than the
// old loop, and the playhead was somehow outside the old loop.
DEBUG_ASSERT(adjustedPosition < newLoopEndPosition);
VERIFY_OR_DEBUG_ASSERT(adjustedPosition >= newLoopStartPosition) {
// This can happen when offset calculation above has double precision
// issues (noticed around 0.00) which shifts the pos beyond loop in
qWarning()
<< "SHOULDN'T HAPPEN: adjustedPositionInsideAdjustedLoop "
"couldn't find a new position --"
"set new position to before in point --"
<< " seeking to in point";
adjustedPosition = newLoopStartPosition;
}
Expand All @@ -1761,9 +1761,11 @@ mixxx::audio::FramePos LoopingControl::adjustedPositionInsideAdjustedLoop(
adjustedPosition += adjustSteps * newLoopSize;
DEBUG_ASSERT(adjustedPosition >= newLoopStartPosition);
VERIFY_OR_DEBUG_ASSERT(adjustedPosition < newLoopEndPosition) {
// This can happen when offset calculation above has double precision
// issues (noticed around 0.00) which shifts the pos beyond loop out
qWarning()
<< "SHOULDN'T HAPPEN: adjustedPositionInsideAdjustedLoop "
"couldn't find a new position --"
"set new position to out point or later--"
<< " seeking to in point";
adjustedPosition = newLoopStartPosition;
}
Expand Down