Sign in to follow this  
Modred

[SDL_mixer] The correct way for a playlist

Recommended Posts

Modred    100
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 [b][i]then [/i][/b]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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this