summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b93d2d7)
raw | patch | inline | side by side (parent: b93d2d7)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 7 Apr 2016 03:51:40 +0000 (06:51 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 7 Apr 2016 03:51:40 +0000 (06:51 +0300) |
src/engine/e_sound.pas | patch | blob | history |
diff --git a/src/engine/e_sound.pas b/src/engine/e_sound.pas
index 76f9929f729f4f07e424bae5bdbe0aef4524bef9..46d7584c06b7717615ce951fcd6da7039153e565 100644 (file)
--- a/src/engine/e_sound.pas
+++ b/src/engine/e_sound.pas
Result := False;
SoundInitialized := False;
-{ // wow, this is actually MIDI player!
+ // wow, this is actually MIDI player!
// we need module player
- if (Mix_Init(MIX_INIT_MOD) and MIX_INIT_MOD) <> MIX_INIT_MOD then
- begin
- e_WriteLog('Error initializing SDL module player:', MSG_FATALERROR);
- e_WriteLog(Mix_GetError(), MSG_FATALERROR);
- //Exit;
- end;
-}
-
- res := Mix_OpenAudio(44100, AUDIO_S16LSB, 2, 2048);
+ res := Mix_Init(MIX_INIT_MOD or MIX_INIT_MP3 or MIX_INIT_OGG or MIX_INIT_FLAC);
+ if (res and MIX_INIT_FLAC) <> 0 then e_WriteLog('SDL: FLAC playback is active', MSG_NOTIFY);
+ if (res and MIX_INIT_MOD) <> 0 then e_WriteLog('SDL: MOD/MIDI playback is active', MSG_NOTIFY);
+ if (res and MIX_INIT_MP3) <> 0 then e_WriteLog('SDL: MP3 playback is active', MSG_NOTIFY);
+ if (res and MIX_INIT_OGG) <> 0 then e_WriteLog('SDL: OGG playback is active', MSG_NOTIFY);
+
+ res := Mix_OpenAudio(48000, AUDIO_S16LSB, 2, 2048);
+ if res = -1 then res := Mix_OpenAudio(44100, AUDIO_S16LSB, 2, 2048);
if res = -1 then
begin
e_WriteLog('Error initializing SDL mixer:', MSG_FATALERROR);