aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathrxx2019-04-15 23:56:02 +0200
committerathrxx2019-07-17 17:38:24 +0200
commit97ea9fd7042fceb9a692937d167a54f92750e470 (patch)
treeb54d12bbb916ccf46cac357fecebd10065447f4b
parent4c45f9f39f3aa0bfee70fc81b7d0938de12dfdf0 (diff)
downloadscummvm-rg350-97ea9fd7042fceb9a692937d167a54f92750e470.tar.gz
scummvm-rg350-97ea9fd7042fceb9a692937d167a54f92750e470.tar.bz2
scummvm-rg350-97ea9fd7042fceb9a692937d167a54f92750e470.zip
KYRA: (EOB/Amiga) - t
-rw-r--r--engines/kyra/sound/drivers/audiomaster2.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/kyra/sound/drivers/audiomaster2.cpp b/engines/kyra/sound/drivers/audiomaster2.cpp
index 261c813b0f..a4f7a3e661 100644
--- a/engines/kyra/sound/drivers/audiomaster2.cpp
+++ b/engines/kyra/sound/drivers/audiomaster2.cpp
@@ -892,6 +892,8 @@ void AudioMaster2ResourceManager::initResource(SoundResource *resource) {
if (!resource)
return;
+ Common::StackLock lock(_mutex);
+
SoundResource *res = retrieveFromChain(resource->getName());
// The driver does not replace resources with the same name, but disposes the new resource instead.
// So these names seem to be considered "globally unique".
@@ -1284,7 +1286,7 @@ void AudioMaster2Internal::fadeOut(int delay) {
}
bool AudioMaster2Internal::isFading() {
- return _io->isFading();
+ return _ready ? _io->isFading() : false;
}
void AudioMaster2Internal::setMusicVolume(int volume) {
@@ -1313,18 +1315,18 @@ void AudioMaster2Internal::resetCounter() {
}
int AudioMaster2Internal::getPlayDuration() {
- return _durationCounter;
+ return _ready ? _durationCounter : 0;
}
void AudioMaster2Internal::sync(SoundResource *res) {
if (!_ready || !res)
return;
+ Common::StackLock lock(_mutex);
+
if (res->getType() != 1)
return;
- Common::StackLock lock(_mutex);
-
SoundResourceSMUS *smus = static_cast<SoundResourceSMUS*>(res);
_io->_tempo = smus->getTempo();
smus->setSync(_io->_sync);