SCI: fix music handling during auto-save

This commit is contained in:
athrxx
2022-05-01 13:46:05 +03:00
committed by Filippos Karapetis
parent 268a8790bc
commit c2975276a3
+9 -2
View File
@@ -261,10 +261,17 @@ void SciMusic::clearPlayList() {
void SciMusic::pauseAll(bool pause) {
const MusicList::iterator end = _playList.end();
bool alreadyUnpaused = (_globalPause <= 0);
if (pause)
_globalPause++;
else
_globalPause = MAX<int>(_globalPause - 1, 0);
_globalPause--;
bool stillUnpaused = (_globalPause <= 0);
if (alreadyUnpaused && stillUnpaused)
return;
for (MusicList::iterator i = _playList.begin(); i != end; ++i) {
#ifdef ENABLE_SCI32
// The entire DAC will have been paused by the caller;
@@ -797,7 +804,7 @@ void SciMusic::soundResume(MusicEntry *pSnd) {
pSnd->pauseCounter--;
if (pSnd->pauseCounter != 0)
return;
if (pSnd->status != kSoundPaused || (_globalPause && !_needsResume))
if (pSnd->status != kSoundPaused || (_globalPause > 0 && !_needsResume))
return;
_needsResume = (_soundVersion > SCI_VERSION_0_LATE);
if (pSnd->pStreamAud) {