fix chirp on startup

This commit is contained in:
Jorj Bauer 2020-07-15 10:19:41 -04:00
parent e138f7be3f
commit ae47fb63df

View File

@ -15,10 +15,12 @@ extern "C"
#include "globals.h"
#define SDLSIZE (4096)
#define SDLSIZE (2048)
// But we want to keep more than just that, so we can fill it full every time
#define CACHEMULTIPLIER 2
#define WATERLEVEL SDLSIZE
// FIXME: Globals; ick.
static volatile uint32_t bufIdx = 0;
static volatile short soundBuf[CACHEMULTIPLIER*SDLSIZE];
@ -50,7 +52,7 @@ static void audioCallback(void *unused, Uint8 *stream, int len)
return;
}
if (audioRunning==1 && bufIdx >= SDLSIZE) {
if (audioRunning==1 && bufIdx >= WATERLEVEL) {
// Fully up and running now; we got a full cache
audioRunning = 2;
} else if (audioRunning==1) {