From 00fcc1851d9ebf38d6fd85e09881c71c5808a1e1 Mon Sep 17 00:00:00 2001 From: plagman Date: Mon, 11 Jan 2010 19:00:32 +0000 Subject: [PATCH] Don't process the SDL_mixer effect if we're not done initializing. git-svn-id: https://svn.eduke32.com/eduke32@1585 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/jaudiolib/src/driver_sdl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/jaudiolib/src/driver_sdl.c b/polymer/eduke32/source/jaudiolib/src/driver_sdl.c index 82054ef38..a063ab169 100644 --- a/polymer/eduke32/source/jaudiolib/src/driver_sdl.c +++ b/polymer/eduke32/source/jaudiolib/src/driver_sdl.c @@ -65,6 +65,9 @@ static void fillData(int32_t chan, void *ptr, int32_t remaining, void *udata) UNREFERENCED_PARAMETER(chan); UNREFERENCED_PARAMETER(udata); + + if (!MixBuffer || !MixCallBack) + return; SDL_LockMutex(EffectFence); @@ -152,8 +155,8 @@ int32_t SDLDrv_PCM_Init(int32_t *mixrate, int32_t *numchannels, int32_t *sampleb } chunksize = 512; - - if (*mixrate >= 16000) chunksize *= 2; + + if (*mixrate >= 16000) chunksize *= 2; if (*mixrate >= 32000) chunksize *= 2; err = Mix_OpenAudio(*mixrate, (*samplebits == 8) ? AUDIO_U8 : AUDIO_S16SYS, *numchannels, chunksize);