Announcing SDL_mixer 1.2.4

This is an important bug fix release, fixing a sound deadlock, and
adding some useful functionality.

Please get the update ASAP from:
http://www.libsdl.org/projects/SDL_mixer/

Here is the full list of changes for this release:

  • Updated the CodeWarrior project files
  • Added a function to query the music format: Mix_GetMusicType()
  • Added a function to load audio data from memory: Mix_QuickLoad_RAW()
  • Cleaned up threading issues in the music playback code
  • Fixed deadlock introduced in the last release

Enjoy!
-Sam Lantinga, Software Engineer, Blizzard Entertainment_______________________________________________
SDL-announce mailing list
SDL-announce at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl-announce

  • Cleaned up threading issues in the music playback code

I take it this means that SDL_mixer is natively multithreaded (and we don’t
have to worry about it?)

I’m working on a dev library for application based on SDL and I want to make
it as well threaded as possible, while making it as easy to use as possible,
and I just started looking at SDL_mixer and am seriously thinking of using
it. (I already know I’m using SDL & SDL_Image, and will use SDL_Net and
FreeType (hey! that’s not SDL, though it does use it)).

-Jim

  • Cleaned up threading issues in the music playback code

I take it this means that SDL_mixer is natively multithreaded (and we don’t
have to worry about it?)

Yep, it should be thread-safe.

A general word of caution though, don’t make something multi-threaded
unless you are really sure you need to. It multiplies the bugs and often
doesn’t improve performance because of critical section contention.

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I take it this means that SDL_mixer is natively multithreaded (and we don’t
have to worry about it?)
I’m working on a dev library for application based on SDL and I want to make
it as well threaded as possible, while making it as easy to use as possible,
and I just started looking at SDL_mixer and am seriously thinking of using
it.

On Unix (and Unix-like systems such as BeOS) and Windows platforms, SDL
spins a thread that idles until the audio device needs more data, and then
it calls a user-defined function to get that data. SDL_mixer specifies
that function (so you initialize the mixer library and not SDL’s audio
subsystem directly), and does the mixing/other effects in there. In short,
it’s multithreaded.

On MacOS Classic, where there are no threads, the system preempts your
application when it needs to feed the audio device by running the
user-defined function (SDL_mixer’s mixing code) in a hardware interrupt,
which gives the same effect.

(I already know I’m using SDL & SDL_Image, and will use SDL_Net and
FreeType (hey! that’s not SDL, though it does use it)).

SDL_ttf is an SDL wrapper for FreeType, in case you want the whole
collection. :slight_smile:

–ryan.

A general word of caution though, don’t make something multi-threaded
unless you are really sure you need to. It multiplies the bugs and often
doesn’t improve performance because of critical section contention.

Amen.

–ryan.