dxx-rebirth/similar/arch
Kp 1b8ff6ac77 SDL2-mixer: fix noise from reading undefined sound data
Commit a833d73d44 added the SDL_mixer backend for Rebirth sound.  That
commit set the length of the converted sound equal to the size of the
buffer that SDL requested as a work area.  No one ever touched that
logic, until now.  In SDL1, that choice worked fine.  In SDL2, this
causes garbage to play after the sound, because SDL2 considers the
buffer to be defined only up to the length returned in
`SDL_AudioCVT::cvt_len`.  Bytes beyond that length are undefined[1], and
in practice contain garbage.  Fix the noise by setting the sound length
equal to the length returned by SDL2, so that the undefined bytes are
not treated as sound.  SDL1 also maintains this length value, so no
version-specific logic is required.

[1]: https://wiki.libsdl.org/SDL_ConvertAudio

Reported-by: heftig <https://github.com/dxx-rebirth/dxx-rebirth/issues/396>
2018-07-30 00:49:59 +00:00
..
ogl Enable building with SDL2 2018-07-28 23:22:58 +00:00
sdl SDL2-mixer: fix noise from reading undefined sound data 2018-07-30 00:49:59 +00:00
win32 Add experimental Windows manifest 2017-08-02 02:49:12 +00:00