mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
audio: Fixed off-by-one error in upsampling.
This commit is contained in:
parent
dad07f960b
commit
a80cb672e3
@ -314,7 +314,7 @@ SDL_ResampleAudioSimple(const int chans, const double rate_incr,
|
|||||||
SDL_memcpy(last_sample, final_sample, framelen);
|
SDL_memcpy(last_sample, final_sample, framelen);
|
||||||
}
|
}
|
||||||
|
|
||||||
dst = (outbuf + (dest_samples * chans)) - 1;
|
dst = (outbuf + (dest_samples * chans));
|
||||||
} else { /* downsample */
|
} else { /* downsample */
|
||||||
float *target = (outbuf + (dest_samples * chans));
|
float *target = (outbuf + (dest_samples * chans));
|
||||||
dst = outbuf;
|
dst = outbuf;
|
||||||
@ -410,7 +410,7 @@ SDL_ResampleAudioSimple_si16_c2(const double rate_incr,
|
|||||||
last_sample[1] = final_right;
|
last_sample[1] = final_right;
|
||||||
last_sample[0] = final_left;
|
last_sample[0] = final_left;
|
||||||
|
|
||||||
dst = (outbuf + (dest_samples * chans)) - 1;
|
dst = (outbuf + (dest_samples * chans));
|
||||||
} else {
|
} else {
|
||||||
Sint16 *target = (outbuf + (dest_samples * chans));
|
Sint16 *target = (outbuf + (dest_samples * chans));
|
||||||
dst = outbuf;
|
dst = outbuf;
|
||||||
|
Loading…
Reference in New Issue
Block a user