audio: calculate resampling time directly, don't increment (thanks, Eric!).

Fixes buffer overruns as floating point errors accumulate.

Partially fixes Bugzilla #3848.
Ryan C. Gordon 2017-10-11 11:43:35 -04:00
parent 763c387149
commit b2f5123b65
1 changed files with 1 additions and 1 deletions

View File

@ -527,7 +527,7 @@ SDL_ResampleAudio(const int chans, const int inrate, const int outrate,
*(dst++) = outsample; *(dst++) = outsample;
} }
outtime += outtimeincr; outtime = i * outtimeincr;
} }
return outframes * chans * sizeof (float); return outframes * chans * sizeof (float);