mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-09-30 02:48:10 +03:00
Fix MAKO::check_music()
This fixes infinite loop in the opening demo of Only You, waiting for the end of the music.
This commit is contained in:
+13
-1
@@ -353,12 +353,24 @@ void MAKO::stop_music()
|
||||
delete music;
|
||||
music = nullptr;
|
||||
}
|
||||
SDL_PauseAudio(1);
|
||||
if (fm) {
|
||||
SDL_PauseAudio(1);
|
||||
SDL_LockMutex(fm_mutex);
|
||||
fm = nullptr;
|
||||
SDL_UnlockMutex(fm_mutex);
|
||||
}
|
||||
current_music = 0;
|
||||
}
|
||||
|
||||
bool MAKO::check_music()
|
||||
{
|
||||
if (fm) {
|
||||
int mark, loop;
|
||||
SDL_LockMutex(fm_mutex);
|
||||
fm->get_mark(&mark, &loop);
|
||||
SDL_UnlockMutex(fm_mutex);
|
||||
return !loop;
|
||||
}
|
||||
return music && music->is_playing();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user