summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 05a8dcb)
raw | patch | inline | side by side (parent: 05a8dcb)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 30 Apr 2020 16:37:01 +0000 (19:37 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 30 Apr 2020 16:37:01 +0000 (19:37 +0300) |
src/engine/e_soundfile_wav.pas | patch | blob | history |
index 84ea42df4c5c12068309086e75f61ff2941c2593..153cad427f4f1b58c94f60977644c9dedeb882ec 100644 (file)
uses
{$IFDEF USE_SDL}
- SDL,
+ SDL, cmem,
{$ELSE}
SDL2,
{$ENDIF}
AUDIO_U8, AUDIO_S8 : tformat := AUDIO_U8; (* yes, unsigned *)
AUDIO_U16LSB, AUDIO_U16MSB: tformat := AUDIO_S16SYS; (* and yes, signed *)
AUDIO_S16LSB, AUDIO_S16MSB: tformat := AUDIO_S16SYS;
+ {$IFDEF USE_SDL2}
AUDIO_S32LSB, AUDIO_S32MSB: tformat := AUDIO_S16SYS; (* 32bit not supported in al core *)
AUDIO_F32LSB, AUDIO_F32MSB: tformat := AUDIO_S16SYS; (* float not supported in al core *)
+ {$ENDIF}
else result := false (* unsupported format *)
end;
if (result = true) and (format <> tformat) then
Result := False;
if SDL_BuildAudioCVT(@cvt, format, chan, rate, tformat, chan, rate) <> -1 then
begin
- buf := SDL_realloc(buf, len * cvt.len_mult);
+ {$IFDEF USE_SDL2}
+ buf := SDL_realloc(buf, len * cvt.len_mult);
+ {$ELSE}
+ buf := realloc(buf, len * cvt.len_mult);
+ {$ENDIF}
cvt.len := len;
cvt.buf := buf;
result := SDL_ConvertAudio(@cvt) = 0;