Skip to content

Do not restart music that is already playing#4680

Open
Loobinex wants to merge 2 commits intomasterfrom
nomusiclogcrash
Open

Do not restart music that is already playing#4680
Loobinex wants to merge 2 commits intomasterfrom
nomusiclogcrash

Conversation

@Loobinex
Copy link
Copy Markdown
Member

Fixes #4505

@Loobinex Loobinex requested a review from cerwym April 18, 2026 11:41
Copy link
Copy Markdown
Contributor

@cerwym cerwym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this so play_music is the only function modified and the callers remain dumb;

std::lock_guard<std::mutex> guard(g_mix_mutex);
    if (strcmp(game.music_fname, fname) == 0) {
JUSTLOG("doing nothing because %d is still playing", game.music_track);
        return true;
    }
    game.music_track = -1;

Would give you the same effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on set_music in a loop

2 participants