Commit 5e5f2290f288551ec70ed39715c4b726d8d9856e

Ryan C. Gordon 2017-10-11T12:07:43

audio: Turns out the accumulation errors sound better. :/ Moving to double fixed the overflows, but using "time = i * incr" instead of "time += incr" causes clicks in the output.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c
index 9bfe6d5..4c8db0f 100644
--- a/src/audio/SDL_audiocvt.c
+++ b/src/audio/SDL_audiocvt.c
@@ -527,7 +527,7 @@ SDL_ResampleAudio(const int chans, const int inrate, const int outrate,
             *(dst++) = outsample;
         }
 
-        outtime = i * outtimeincr;
+        outtime += outtimeincr;
     }
 
     return outframes * chans * sizeof (float);