Skip to content

Commit

Permalink
CachingReader: Remove wrong debug assertion (lp1946759)
Browse files Browse the repository at this point in the history
When setting a loop in front of the actual track (i.e. so that the end
of the loop is before the first audio frame), this debug assertion is
always triggered:

    DEBUG ASSERT: "hintFrameCount >= 0" in function void CachingReader::hintAndMaybeWake(const HintVector&) at /home/jan/Projects/mixxx/src/engine/cachingreader/cachingreader.cpp:535

Steps to reproduce:

1. Go to the beginning of the track
2. Use beatjump to go to 8 beats before the beginning of the track
3. Set a beatloop of 4 beats
4. Assertion is triggered

This fixes the issue by just ignoring the negative hint lengths
without triggering an assertion.

This also re-adds the skipping of zero-length hints that was removed by
7d96c38 (mixxxdj#3081) to avoid triggering the
assertion. However, I think skipping was correct in the zero length
case, just triggering the assertion was not.

See https://bugs.launchpad.net/mixxx/+bug/1946759 for details.

The commit that originally introduced this assertion is
8589930 (mixxxdj#1223).
  • Loading branch information
Holzhaus committed Oct 12, 2021
1 parent 7b22498 commit 46b1b1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/engine/cachingreader/cachingreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ void CachingReader::hintAndMaybeWake(const HintVector& hintList) {
}
}

VERIFY_OR_DEBUG_ASSERT(hintFrameCount >= 0) {
kLogger.warning() << "CachingReader: Ignoring negative hint length.";
if (hintFrameCount <= 0) {
kLogger.debug() << "CachingReader: Ignoring non-positive hint length.";
continue;
}

Expand Down

0 comments on commit 46b1b1b

Please sign in to comment.