From da6a260461920d4cafd4c6d1d624aebf2d9b975c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 23 Mar 2014 21:43:12 -0400 Subject: Rearrange order of SDL sound startup. Initialize low-level sound startup (calls to I_InitSound) separately from the high-level sound startup (S_Init). In particular, make sure that SDL sound is initialized before the textscreen multiplayer waiting screen is shown. This is an attempt to fix a bug with sound in multiplayer games on Windows; calling SDL_QuitSubSystem(SDL_INIT_VIDEO) (on closedown of the textscreen library) causes subsequent attempts to initialize audio to fail. Big thanks go to Alexandre-Xavier (AXDOOMER) for working out a fix for this bug and James Haley (Quasar) for giving some technical background about the lack of separation between SDL subsystems. This (hopefully) fixes #270. --- src/hexen/h2_main.c | 2 ++ src/hexen/s_sound.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/hexen') diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index 07244417..0afdff24 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -325,6 +325,8 @@ void D_DoomMain(void) I_CheckIsScreensaver(); I_InitTimer(); I_InitJoystick(); + I_InitSound(false); + I_InitMusic(); #ifdef FEATURE_MULTIPLAYER ST_Message("NET_Init: Init networking subsystem.\n"); diff --git a/src/hexen/s_sound.c b/src/hexen/s_sound.c index f6509d1c..3f1a1e76 100644 --- a/src/hexen/s_sound.c +++ b/src/hexen/s_sound.c @@ -796,8 +796,6 @@ void S_Init(void) SoundCurve = W_CacheLumpName("SNDCURVE", PU_STATIC); // SoundCurve = Z_Malloc(MAX_SND_DIST, PU_STATIC, NULL); - I_InitSound(false); - if (snd_Channels > 8) { snd_Channels = 8; -- cgit v1.2.3