index ccfd9c4bc2715732e3d746db9f45e1f02065ff9d..afbb8758f3658b92da93419d4f11737c80b3a87f 100644 (file)
uses
{$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
uses
{$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
- SDL2, SDL2_mixer,
+ SDL2, SDL2_mixer, envvars,
e_log, SysUtils;
type
e_log, SysUtils;
type
{$IFDEF HEADLESS}
// HACK: shit this into env and hope for the best
SetEnvVar('SDL_AUDIODRIVER', 'dummy');
{$IFDEF HEADLESS}
// HACK: shit this into env and hope for the best
SetEnvVar('SDL_AUDIODRIVER', 'dummy');
- {$ELSEIF}
+ {$ENDIF}
if NoOutput then begin Result := true; Exit end;
if NoOutput then begin Result := true; Exit end;
if (res and MIX_INIT_FLUIDSYNTH) <> 0 then e_WriteLog('SDL: FLUIDSYNTH playback is active', TMsgType.Notify);
e_WriteLog(Format('SDL: initializing mixer at %d with buffer %d', [gsSDLSampleRate, gsSDLBufferSize]), TMsgType.Notify);
if (res and MIX_INIT_FLUIDSYNTH) <> 0 then e_WriteLog('SDL: FLUIDSYNTH playback is active', TMsgType.Notify);
e_WriteLog(Format('SDL: initializing mixer at %d with buffer %d', [gsSDLSampleRate, gsSDLBufferSize]), TMsgType.Notify);
- res := Mix_OpenAudio(gsSDLSampleRate, AUDIO_S16LSB, 2, gsSDLBufferSize);
+ res := Mix_OpenAudio(gsSDLSampleRate, {$IFDEF FPC_LITTLE_ENDIAN}AUDIO_S16LSB{$ELSE}AUDIO_S16MSB{$ENDIF}, 2, gsSDLBufferSize);
if res = -1 then
begin
e_WriteLog('Error initializing SDL mixer:', TMsgType.Fatal);
if res = -1 then
begin
e_WriteLog('Error initializing SDL mixer:', TMsgType.Fatal);