mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
audio: removed conditional from simple resampler's inner loop.
We never seem to overflow the source buffer now; this might have been a leftover from a bug that was covered by Vitaly's fixes? Removing this conditional makes the resampler 10-20% faster. Left an assert in there for debug builds, in case this still happens.
This commit is contained in:
parent
4f981df37f
commit
83454c821f
@ -211,7 +211,8 @@ SDL_ResampleAudioSimple(const int chans, const double rate_incr,
|
||||
|
||||
while (dst < target) {
|
||||
const int pos = ((int)idx) * chans;
|
||||
const float *src = &inbuf[(pos >= finalpos) ? finalpos : pos];
|
||||
const float *src = &inbuf[pos];
|
||||
SDL_assert(pos <= finalpos);
|
||||
for (i = 0; i < chans; i++) {
|
||||
const float val = *(src++);
|
||||
*(dst++) = (val + last_sample[i]) * 0.5f;
|
||||
|
Loading…
Reference in New Issue
Block a user