shithub: choc

Download patch

ref: f7e752f3527cdbab73c83f1d31878ec151d53510
parent: ecab8d3ac0ca34fbb6cb04b608926a57b6dbdcc5
parent: c3a7be8768553ba21c7601a4c94898a1e777fce1
author: Simon Howard <fraggle+github@gmail.com>
date: Thu Mar 14 13:16:21 EDT 2019

Merge pull request #1150 from chocolate-doom/mix_init

sound: Initialize SDL_Mixer for digital/MIDI music playback

--- a/src/i_musicpack.c
+++ b/src/i_musicpack.c
@@ -1148,6 +1148,9 @@
         music_initialized = true;
     }
 
+    // Initialize SDL_Mixer for digital music playback
+    Mix_Init(MIX_INIT_FLAC | MIX_INIT_OGG | MIX_INIT_MP3);
+
     // Register an effect function to track the music position.
     Mix_RegisterEffect(MIX_CHANNEL_POST, TrackPositionCallback, NULL, NULL);
 
--- a/src/i_sdlmusic.c
+++ b/src/i_sdlmusic.c
@@ -194,6 +194,11 @@
         }
     }
 
+#ifdef MIX_INIT_MID
+    // Initialize SDL_Mixer for MIDI music playback
+    Mix_Init(MIX_INIT_MID);
+#endif
+
     // Once initialization is complete, the temporary Timidity config
     // file can be removed.