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

CachingReader: Fix assertion when loop is before track start (lp1946759) #4383

Merged
merged 1 commit into from Oct 12, 2021

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented Oct 12, 2021

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 (#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 (#1223).

@Holzhaus Holzhaus added this to the 2.4.0 milestone Oct 12, 2021
@Holzhaus
Copy link
Member Author

@uklotzde @daschuer It may also be possible that we can skip even earlier in the call stack and the debug assertion is in fact correct. I'm not familiar enough with that part of the code to judge.

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), a 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

See https://bugs.launchpad.net/mixxx/+bug/1946759 for details.
@Holzhaus Holzhaus changed the title CachingReader: Remove wrong debug assertion (lp1946759) CachingReader: Fix assertion when loop is before track start (lp1946759) Oct 12, 2021
@uklotzde
Copy link
Contributor

Thank you! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants