Round the converter's stepping value

This commit is contained in:
Chris Robinson 2017-06-26 11:04:23 -07:00
parent 2f2d941edb
commit b13fead555

View File

@ -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