diff options
author | athrxx | 2019-10-14 19:03:24 +0200 |
---|---|---|
committer | athrxx | 2019-10-31 13:10:22 +0100 |
commit | 1a08072deaf1e574ce3dd4c7ce7d14efdeb3171a (patch) | |
tree | b432f32e53761ce5073ade29e74f6e5e1b33d48b /engines | |
parent | 6444d279fe72f649050e92aaf6fafc423a413b83 (diff) | |
download | scummvm-rg350-1a08072deaf1e574ce3dd4c7ce7d14efdeb3171a.tar.gz scummvm-rg350-1a08072deaf1e574ce3dd4c7ce7d14efdeb3171a.tar.bz2 scummvm-rg350-1a08072deaf1e574ce3dd4c7ce7d14efdeb3171a.zip |
KYRA: (EOB/Amiga) - minor audio driver improvements
(mostly paranoia fixes)
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/sound/drivers/audiomaster2.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/engines/kyra/sound/drivers/audiomaster2.cpp b/engines/kyra/sound/drivers/audiomaster2.cpp index 261c813b0f..5fb8043cf5 100644 --- a/engines/kyra/sound/drivers/audiomaster2.cpp +++ b/engines/kyra/sound/drivers/audiomaster2.cpp @@ -22,7 +22,7 @@ #ifdef ENABLE_EOB -#include "kyra/resource/resource.h" +#include "kyra/kyra_v1.h" #include "kyra/sound/drivers/audiomaster2.h" #include "audio/mods/paula.h" @@ -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". @@ -1198,12 +1200,11 @@ AudioMaster2Internal::AudioMaster2Internal(Audio::Mixer *mixer) : Paula(true, mi } AudioMaster2Internal::~AudioMaster2Internal() { - Common::StackLock lock(_mutex); - stopPaula(); - _mixer->stopHandle(_soundHandle); + Common::StackLock lock(_mutex); + delete _res; delete _io; } @@ -1284,7 +1285,7 @@ void AudioMaster2Internal::fadeOut(int delay) { } bool AudioMaster2Internal::isFading() { - return _io->isFading(); + return _ready ? _io->isFading() : false; } void AudioMaster2Internal::setMusicVolume(int volume) { @@ -1313,18 +1314,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); |