Revert clamping frames_needed
to the allowed mix/max range in the mixer
#3217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This fixes a regression by reverting commit a25af54. The clamping causes the audio to become out of sync when using fast-forward mode in release mode (debug mode is not fast enough, but you can still get the audio out-of-sync by fast forwarding, but to a much lesser extent). Tested with OPL and MT-32 output, but probably all sound devices are affected.
The lack of clamping doesn't cause issues in release builds; it just helped not to trip an assert in debug builds when putting your laptop to sleep while running Staging, then waking the machine up a few seconds later. But this was never a proper fix anyway, just a workaround, so it's no great loss.
The problem should be properly addressed when the whole mixer gets refactored. I really don't have the time for that, and we definitely don't want to break the sound sync when fast-forwarding.
Related issues
Reverts #2843
Manual testing
Before fix
After fix
Repeat the same steps—the audio always stays in perfect sync, no matter for how long you've been fast-forwarding.
Checklist
Please tick the items as you have addressed them. Don't remove items; leave the ones that are not applicable unchecked.
I have: