aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/converter.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-06-26 11:04:23 -0700
committerChris Robinson <[email protected]>2017-06-26 11:04:23 -0700
commitb13fead555c6dba54844a1e16e79d717eab8c965 (patch)
tree99c654579ab9aa7a39f1d01d867acb617756f5d0 /Alc/converter.c
parent2f2d941edb61767689a1a80940ea539681648807 (diff)
Round the converter's stepping value
Diffstat (limited to 'Alc/converter.c')
-rw-r--r--Alc/converter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Alc/converter.c b/Alc/converter.c
index 20789135..3a926797 100644
--- a/Alc/converter.c
+++ b/Alc/converter.c
@@ -26,8 +26,9 @@ SampleConverter *CreateSampleConverter(enum DevFmtType srcType, enum DevFmtType
/* Have to set the mixer FPU mode since that's what the resampler code expects. */
SetMixerFPUMode(&oldMode);
- converter->mIncrement = (ALsizei)clampu64((ALuint64)srcRate*FRACTIONONE/dstRate,
- 1, MAX_PITCH*FRACTIONONE);
+ converter->mIncrement = (ALsizei)clampu64(
+ ScaleRound(srcRate, FRACTIONONE, dstRate), 1, MAX_PITCH*FRACTIONONE
+ );
if(converter->mIncrement == FRACTIONONE)
converter->mResample = Resample_copy32_C;
else