diff options
author | Matthew Hoops | 2015-09-29 01:11:17 -0400 |
---|---|---|
committer | Johannes Schickel | 2016-03-13 13:53:08 +0100 |
commit | c0e11a431dd5c4a82ab754c3f94bb95ee46de792 (patch) | |
tree | 8eac750d66c49f63abe1212d5a206ea18e4134d1 /engines/sci | |
parent | 016a6000e425bf4b5b696eae93316afbba15eb79 (diff) | |
download | scummvm-rg350-c0e11a431dd5c4a82ab754c3f94bb95ee46de792.tar.gz scummvm-rg350-c0e11a431dd5c4a82ab754c3f94bb95ee46de792.tar.bz2 scummvm-rg350-c0e11a431dd5c4a82ab754c3f94bb95ee46de792.zip |
SCI: Ensure openCD() is called
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/sound/audio.cpp | 9 | ||||
-rw-r--r-- | engines/sci/sound/audio.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 57f0415285..5e5e8b0466 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -28,6 +28,7 @@ #include "backends/audiocd/audiocd.h" +#include "common/config-manager.h" #include "common/file.h" #include "common/memstream.h" #include "common/system.h" @@ -44,7 +45,7 @@ namespace Sci { AudioPlayer::AudioPlayer(ResourceManager *resMan) : _resMan(resMan), _audioRate(11025), - _syncResource(NULL), _syncOffset(0), _audioCdStart(0) { + _syncResource(NULL), _syncOffset(0), _audioCdStart(0), _initCD(false) { _mixer = g_system->getMixer(); _wPlayFlag = false; @@ -511,6 +512,12 @@ void AudioPlayer::stopSoundSync() { } int AudioPlayer::audioCdPlay(int track, int start, int duration) { + if (!_initCD) { + // Initialize CD mode if we haven't already + g_system->getAudioCDManager()->openCD(); + _initCD = true; + } + if (getSciVersion() == SCI_VERSION_1_1) { // King's Quest VI CD Audio format _audioCdStart = g_system->getMillis(); diff --git a/engines/sci/sound/audio.h b/engines/sci/sound/audio.h index 9e65d6e0c8..4a8b26567d 100644 --- a/engines/sci/sound/audio.h +++ b/engines/sci/sound/audio.h @@ -97,6 +97,7 @@ private: uint _syncOffset; uint32 _audioCdStart; bool _wPlayFlag; + bool _initCD; }; } // End of namespace Sci |