From 75344a15162f6ff69954dac35e624b35d1424f09 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Wed, 23 Sep 2020 17:12:41 +0200 Subject: [PATCH] loopcontrol: prevent moving a loop beyond track end --- src/engine/controls/loopingcontrol.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engine/controls/loopingcontrol.cpp b/src/engine/controls/loopingcontrol.cpp index fbce5c8a8d5a..bc062799b12b 100644 --- a/src/engine/controls/loopingcontrol.cpp +++ b/src/engine/controls/loopingcontrol.cpp @@ -1245,6 +1245,12 @@ void LoopingControl::slotLoopMove(double beats) { pBeats->findNBeatsFromSample(new_loop_in, m_pCOBeatLoopSize->get()) : pBeats->findNBeatsFromSample(loopSamples.end, beats); + // The track would stop as soon as the playhead crosses track end, + // so we don't allow moving a loop beyond end. + // https://bugs.launchpad.net/mixxx/+bug/1799574 + if (new_loop_out > m_pTrackSamples->get()) { + return; + } // If we are looping make sure that the play head does not leave the // loop as a result of our adjustment. loopSamples.seek = m_bLoopingEnabled;