foxygit / doom Log in
commit 4edede3f4a10bc7ce8685f61f618e04eb38acef6
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Sun Oct 22 18:36:27 2017 -0400
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Sun Oct 22 18:36:27 2017 -0400

    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.
---
 src/i_sdlsound.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index c7ca28b9..32653099 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -1071,10 +1071,21 @@ static boolean I_SDL_InitSound(boolean _use_sfx_prefix)
 {
     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;