[SDL] endianness in SDL_audio.c

Albert Cahalan albert at users.sf.net
Thu Jan 27 07:49:25 PST 2005


On Thu, 2005-01-27 at 16:37 +0100, Patrice Mandin wrote:
> Le Thu, 27 Jan 2005 15:40:06 +0100 (CET)
> Frode Tennebø <frodet at nvg.ntnu.no> a écrit:
> 
> > I had a small problem with an audio stream in LSB while the application 
> > ran on an Sparc (big-endian). It took some time tracking it down, but I 
> > believe I have found a solution. However, I'm not sure if the original 
> > code was intended that way or not, but this Works For Me (tm):
...
> You're right somewhere. I think there is also a problem. I build SDL for
> Atari (m68k, big-endian), and the loopwave SDL demo program was not
> playing sample.wav correctly. And I was wondering where the bug was. More
> investigation needed.

I have a Mac running Linux, and have hit this problem
in many programs.

The root of the problem is that developers use AUDIO_S16
when they should be using AUDIO_S16SYS. I recently fixed
Tux Paint, then patched up a wiki somewhere to warn about
the issue. App developers are pretty much led into using
AUDIO_S16 instead of the correct AUDIO_S16SYS.

As far as I can tell, one should never use AUDIO_S16 in
app code. It should be removed from the headers I think.

SDL_mixer.h has a MIX_DEFAULT_FORMAT that really should be
defined as AUDIO_S16SYS.






More information about the SDL mailing list