• Advertisement
Sign in to follow this  

[SDL_mixer] The correct way for a playlist

This topic is 2378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

At some places I read that calling a SDL_mixer function from the function set by Mix_HookMusicFinished() is not so good. Probably because It's called in a different thread, eh?

So would it be correct to set a variable 'playing' to false in that callback, of course protected by a SDL_mutex, and then check in the mainloop whether this variable is false and then play the next track?

Or are there other ways around this? Having another 'update()' function in all those menu etc. loops is something I'd like to avoid if there's a clean way to do so.

Thanks :)

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement