-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ReadAheadManager: fix loop wraparound reader condition #11717
Conversation
@daschuer please take a look. |
Thank you. The changes are looking reasonable. |
src/engine/readaheadmanager.cpp
Outdated
@@ -160,7 +160,7 @@ SINT ReadAheadManager::getNextSamples(double dRate, CSAMPLE* pOutput, | |||
} | |||
} | |||
|
|||
if (crossFadeSamples) { | |||
if (crossFadeSamples >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still trying to figure when crossFadeSamples < 0
occurs.
if I get it right this can happen only if the overshoot (fractional frames?) corrects the curr. play pos AND we're looping over the track start, so that loop_read_position > crossFadeStart
?
so we actually thow away the overshoot, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code below should do nothing in case of 0, so we can safe the time-
if (crossFadeSamples >= 0) { | |
if (crossFadeSamples > 0) { |
|
Oh I was confused because our assertions are Critical and elevated Fatal for a crash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want still investigate why the value is negative. But that can be done after merge.
src/engine/readaheadmanager.cpp
Outdated
@@ -160,7 +160,7 @@ SINT ReadAheadManager::getNextSamples(double dRate, CSAMPLE* pOutput, | |||
} | |||
} | |||
|
|||
if (crossFadeSamples) { | |||
if (crossFadeSamples >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code below should do nothing in case of 0, so we can safe the time-
if (crossFadeSamples >= 0) { | |
if (crossFadeSamples > 0) { |
2a8cc92
to
317176d
Compare
so this one's ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that the value has to be negative, because the loop cue is shifted into the pre-roll.
So this is OK.
Unfortunately this issue is also a 2.3 issue. I will add only the fix to the 2.3 branch without the refactoring.
LGTM
This a the backport of the fix from #11717
should fix a regression caused by #11704 / #11532
noticed because HotcueControlTest.SavedLoopMove failed in Coverage check.
Though requested samples shouldn't be negative in the first place, so maybe we overlooked something.