shithub: choc

Download patch

ref: 4edede3f4a10bc7ce8685f61f618e04eb38acef6
parent: b2efcd139489c4728a461cbcd0dc2b6e7c972db6
author: Simon Howard <fraggle@soulsphere.org>
date: Sun Oct 22 14:36:27 EDT 2017

sound: Refuse to start with SDL 2.0.6.

It's known now (#945) that the game is unusable with SDL 2.0.6 due to
a crash bug in the sound code. To avoid recurring bug reports about
this, add a guard in the sound startup code that will cause the game
startup to abort if the user has v2.0.6 installed.

--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -1071,10 +1071,21 @@
 {
     int i;
 
+    // SDL 2.0.6 has a bug that makes it unusable.
+    if (SDL_COMPILEDVERSION == SDL_VERSIONNUM(2, 0, 6))
+    {
+        I_Error(
+            "I_SDL_InitSound: "
+            "You are trying to launch with SDL 2.0.6 which has a known bug "
+            "that makes the game crash. Please either downgrade to "
+            "SDL 2.0.5 or upgrade to 2.0.7. See the following bug for some "
+            "additional context:\n"
+            "<https://github.com/chocolate-doom/chocolate-doom/issues/945>");
+    }
+
     use_sfx_prefix = _use_sfx_prefix;
 
     // No sounds yet
-
     for (i=0; i<NUM_CHANNELS; ++i)
     {
         channels_playing[i] = NULL;