mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
Hopefully, this will fix some of the oddities happening because of music fading
This commit is contained in:
@@ -442,6 +442,25 @@ void SciMusic::soundPlay(MusicEntry *pSnd) {
|
||||
if (pSnd->pMidiParser) {
|
||||
Common::StackLock lock(_mutex);
|
||||
pSnd->pMidiParser->mainThreadBegin();
|
||||
|
||||
if (pSnd->status != kSoundPaused) {
|
||||
// Stop any in progress music fading, as that will reset the
|
||||
// volume of the sound channels that the faded song occupies..
|
||||
// Fixes bug #3266480 and partially fixes bug #3041738.
|
||||
for (uint i = 0; i < playListCount; i++) {
|
||||
// Is another MIDI song being faded? If yes, stop it
|
||||
// immediately instead
|
||||
if (_playList[i]->fadeStep && _playList[i]->pMidiParser) {
|
||||
_playList[i]->status = kSoundStopped;
|
||||
if (_soundVersion <= SCI_VERSION_0_LATE)
|
||||
_playList[i]->isQueued = false;
|
||||
_playList[i]->pMidiParser->stop();
|
||||
freeChannels(_playList[i]);
|
||||
_playList[i]->fadeStep = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pSnd->pMidiParser->tryToOwnChannels();
|
||||
if (pSnd->status != kSoundPaused)
|
||||
pSnd->pMidiParser->sendInitCommands();
|
||||
|
||||
Reference in New Issue
Block a user