diff libcore/core/sys.c @ 204:c9fbb822d269

core: allocate sound channels at startup
author David Demelier <markand@malikania.fr>
date Tue, 10 Nov 2020 09:10:52 +0100
parents eb0a7ab71023
children 76afe639fd72
line wrap: on
line diff
--- a/libcore/core/sys.c	Mon Nov 09 21:18:41 2020 +0100
+++ b/libcore/core/sys.c	Tue Nov 10 09:10:52 2020 +0100
@@ -32,6 +32,7 @@
 #endif
 
 #include "error.h"
+#include "sound.h"
 #include "sys.h"
 
 #if defined(_WIN32)
@@ -116,6 +117,8 @@
 	if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096) < 0)
 		return errorf("%s", SDL_GetError());
 
+	Mix_AllocateChannels(SOUND_CHANNELS_MAX);
+
 	return true;
 }