audio: Moved unchanging variable out of loop.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 11 Oct 2017 02:31:58 -0400
changeset 1159261260a51fc60
parent 11591 c79a9f64ddb2
child 11593 b5e404b928ea
audio: Moved unchanging variable out of loop.
src/audio/SDL_audiocvt.c
     1.1 --- a/src/audio/SDL_audiocvt.c	Wed Oct 11 02:03:05 2017 -0400
     1.2 +++ b/src/audio/SDL_audiocvt.c	Wed Oct 11 02:31:58 2017 -0400
     1.3 @@ -484,6 +484,7 @@
     1.4                          const float *inbuf, const int inbuflen,
     1.5                          float *outbuf, const int outbuflen)
     1.6  {
     1.7 +    const double finrate = (double) inrate;
     1.8      const float outtimeincr = 1.0f / ((float) outrate);
     1.9      const float ratio = ((float) outrate) / ((float) inrate);
    1.10      const int paddinglen = ResamplerPadding(inrate, outrate);
    1.11 @@ -498,7 +499,6 @@
    1.12  
    1.13      for (i = 0; i < outframes; i++) {
    1.14          const int srcindex = (int) (outtime * inrate);
    1.15 -        const float finrate = (float) inrate;
    1.16          const float intime = ((float) srcindex) / finrate;
    1.17          const float innexttime = ((float) (srcindex + 1)) / finrate;
    1.18