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 debug assertion when hintFrameCount == 0 #3081

Merged
merged 1 commit into from
Sep 8, 2020

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented Sep 8, 2020

This also rephrases the warning message a bit.

Fixes:

Critical [Engine]: DEBUG ASSERT: "hintFrameCount > 0" in function void CachingReader::hintAndMaybeWake(const HintVector&) at src/engine/cachingreader/cachingreader.cpp:533

NOTE: I didn't really look into the code, but I encountered this debug assertion while writing tests for #2194. This fixes the issue for me and is also consistent with the text of the warning message. Please double-check if this is actually correct or if the warning message is wrong!

This also rephrases the warning message a bit.

Fixes:

    Critical [Engine]: DEBUG ASSERT: "hintFrameCount > 0" in function void CachingReader::hintAndMaybeWake(const HintVector&) at src/engine/cachingreader/cachingreader.cpp:533
@Holzhaus Holzhaus added this to the 2.3.0 milestone Sep 8, 2020
@Holzhaus Holzhaus requested a review from uklotzde September 8, 2020 11:07
@uklotzde
Copy link
Contributor

uklotzde commented Sep 8, 2020

The case hintFrameCount = 0 is allowed and handled in the following lines.

LGTM

@uklotzde uklotzde merged commit dbbfb4b into mixxxdj:2.3 Sep 8, 2020
Holzhaus added a commit to Holzhaus/mixxx that referenced this pull request 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 (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).
Holzhaus added a commit to Holzhaus/mixxx that referenced this pull request 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 (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).
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.

2 participants