mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
audio: Moved unchanging variable out of loop.
This commit is contained in:
parent
cb8bf6bbaf
commit
0085f917e0
@ -484,6 +484,7 @@ SDL_ResampleAudio(const int chans, const int inrate, const int outrate,
|
|||||||
const float *inbuf, const int inbuflen,
|
const float *inbuf, const int inbuflen,
|
||||||
float *outbuf, const int outbuflen)
|
float *outbuf, const int outbuflen)
|
||||||
{
|
{
|
||||||
|
const double finrate = (double) inrate;
|
||||||
const float outtimeincr = 1.0f / ((float) outrate);
|
const float outtimeincr = 1.0f / ((float) outrate);
|
||||||
const float ratio = ((float) outrate) / ((float) inrate);
|
const float ratio = ((float) outrate) / ((float) inrate);
|
||||||
const int paddinglen = ResamplerPadding(inrate, outrate);
|
const int paddinglen = ResamplerPadding(inrate, outrate);
|
||||||
@ -498,7 +499,6 @@ SDL_ResampleAudio(const int chans, const int inrate, const int outrate,
|
|||||||
|
|
||||||
for (i = 0; i < outframes; i++) {
|
for (i = 0; i < outframes; i++) {
|
||||||
const int srcindex = (int) (outtime * inrate);
|
const int srcindex = (int) (outtime * inrate);
|
||||||
const float finrate = (float) inrate;
|
|
||||||
const float intime = ((float) srcindex) / finrate;
|
const float intime = ((float) srcindex) / finrate;
|
||||||
const float innexttime = ((float) (srcindex + 1)) / finrate;
|
const float innexttime = ((float) (srcindex + 1)) / finrate;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user