Change the sound buffer size to a power of 2

Turns out giving SDL2 a non-power-of-2 buffer size crashes it in
Emscripten.
This commit is contained in:
Clownacy 2019-05-29 18:49:09 +00:00
parent d2b5872c95
commit 0fb147aa0d

View file

@ -16,9 +16,9 @@
#define FREQUENCY 44100
#ifdef RASPBERRY_PI
#define STREAM_SIZE 0x400
#define STREAM_SIZE 0x400 // Larger buffer to prevent stutter
#else
#define STREAM_SIZE (FREQUENCY / 200)
#define STREAM_SIZE 0x100 // FREQUENCY/200 rounded to the nearest power of 2 (SDL2 *needs* a power-of-2 buffer size)
#endif
#define clamp(x, y, z) (((x) > (z)) ? (z) : ((x) < (y)) ? (y) : (x))