Jump to content
  • Advertisement
Sign in to follow this  

[SDL_mixer] The correct way for a playlist

This topic is 2652 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!