Skip sample rate conversion in Sample if the resampling ratio is 1#8262
Open
sakertooth wants to merge 1 commit intoLMMS:masterfrom
Open
Skip sample rate conversion in Sample if the resampling ratio is 1#8262sakertooth wants to merge 1 commit intoLMMS:masterfrom
Sample if the resampling ratio is 1#8262sakertooth wants to merge 1 commit intoLMMS:masterfrom
Conversation
bab7fe6 to
318ca7f
Compare
SamplePlayHandle and skip conversion when possibleSample if the resampling ratio is 1x
Sample if the resampling ratio is 1xSample if the resampling ratio is 1
messmerd
reviewed
Feb 17, 2026
| if (finalRatio == 1.) | ||
| { | ||
| render(dst, numFrames, state, loop); | ||
| return true; |
Member
There was a problem hiding this comment.
Should this return numFrames < Engine::audioEngine()->framesPerPeriod()?
Contributor
Author
There was a problem hiding this comment.
It should be checking the return value from render actually. Missed that.
Contributor
Author
|
This PR was originally because I thought there was a serious bug, but I realized its mostly fine. It feels wrong to just add a fast path in |
Contributor
Author
|
I was originally intending for this to fix a sound quality issue reported in the Discord but it didn't so I might investigate a bit more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR changes
Sampleto skip resampling entirely if the sample rates match.