From b9a5e9ea0eae3cf61525361ebbdfac279a8f9361 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 30 Dec 2007 16:32:30 +0000 Subject: Fix for bug #1635361: COMI: Music fade-out broken for compressed audio svn-id: r30081 --- engines/scumm/imuse_digi/dimuse.h | 2 +- engines/scumm/imuse_digi/dimuse_track.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h index caff9958f3..df39fd9619 100644 --- a/engines/scumm/imuse_digi/dimuse.h +++ b/engines/scumm/imuse_digi/dimuse.h @@ -137,7 +137,7 @@ private: int getSoundIdByName(const char *soundName); void fadeOutMusic(int fadeDelay); - Track *cloneToFadeOutTrack(const Track *track, int fadeDelay); + Track *cloneToFadeOutTrack(Track *track, int fadeDelay); void setFtMusicState(int stateId); void setFtMusicSequence(int seqId); diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index 383c0281df..1a9d59a214 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -314,7 +314,7 @@ void IMuseDigital::fadeOutMusic(int fadeDelay) { } } -IMuseDigital::Track *IMuseDigital::cloneToFadeOutTrack(const Track *track, int fadeDelay) { +IMuseDigital::Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDelay) { assert(track); Track *fadeTrack = 0; @@ -330,12 +330,11 @@ IMuseDigital::Track *IMuseDigital::cloneToFadeOutTrack(const Track *track, int f // Clone the settings of the given track memcpy(fadeTrack, track, sizeof(Track)); - // Clone the sound. - // According to aquadran, this is only called for bundle files and sound - // data in *.la1 from switchToNextRegion and fadeOutMusic func. Henc we - // know that track->soundDesc != NULL. - fadeTrack->soundDesc = _sound->cloneSound(track->soundDesc); + // Clone the sound. We use the original sound in the fadeTrack, + // and the cloned sound in the original track. This fixes bug #1635361. assert(fadeTrack->soundDesc); + track->soundDesc = _sound->cloneSound(fadeTrack->soundDesc); + assert(track->soundDesc); // Set the volume fading parameters to indicate a fade out fadeTrack->volFadeDelay = fadeDelay; -- cgit v1.2.3