From c8c06ceee988318b7a505c44c6d2eb2d09d46d39 Mon Sep 17 00:00:00 2001 From: jeremy Date: Thu, 4 Jul 2019 22:48:33 +0200 Subject: [PATCH 1/3] Fixed SoundManager::stopSound when output is not initialized (bug #4600 probably) --- apps/openmw/mwsound/soundmanagerimp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw/mwsound/soundmanagerimp.cpp b/apps/openmw/mwsound/soundmanagerimp.cpp index 77f25f326..aa1686f7c 100644 --- a/apps/openmw/mwsound/soundmanagerimp.cpp +++ b/apps/openmw/mwsound/soundmanagerimp.cpp @@ -747,6 +747,9 @@ namespace MWSound void SoundManager::stopSound(const std::string& soundId) { + if(!mOutput->isInitialized()) + return; + Sound_Buffer *sfx = loadSound(Misc::StringUtils::lowerCase(soundId)); if (!sfx) return; @@ -755,6 +758,9 @@ namespace MWSound void SoundManager::stopSound3D(const MWWorld::ConstPtr &ptr, const std::string& soundId) { + if(!mOutput->isInitialized()) + return; + Sound_Buffer *sfx = loadSound(Misc::StringUtils::lowerCase(soundId)); if (!sfx) return; From 962462c1c5bfb07cda13b18a6d6a40ba48427da4 Mon Sep 17 00:00:00 2001 From: jeremy Date: Thu, 4 Jul 2019 22:54:39 +0200 Subject: [PATCH 2/3] Removed unnecessary calls to stopSound3D playSound3D (the one taking a ptr) already stops the sound if it's playing. --- apps/openmw/mwmechanics/character.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 7966526f2..00b3c0c67 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -983,7 +983,6 @@ void CharacterController::handleTextKey(const std::string &groupname, const std: if(evt.compare(0, 7, "sound: ") == 0) { MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager(); - sndMgr->stopSound3D(mPtr, evt.substr(7)); sndMgr->playSound3D(mPtr, evt.substr(7), 1.0f, 1.0f); return; } @@ -1024,7 +1023,6 @@ void CharacterController::handleTextKey(const std::string &groupname, const std: } else { - sndMgr->stopSound3D(mPtr, sound); sndMgr->playSound3D(mPtr, sound, volume, pitch); } } From 940625b1381156912c9e6f590895f8f4e69a9b17 Mon Sep 17 00:00:00 2001 From: jeremy Date: Fri, 5 Jul 2019 08:46:46 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ba7febd1..1ee3d46d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Bug #4384: Resist Normal Weapons only checks ammunition for ranged weapons Bug #4411: Reloading a saved game while falling prevents damage in some cases Bug #4540: Rain delay when exiting water + Bug #4600: Crash when no sound output is available or --no-sound is used. Bug #4639: Black screen after completing first mages guild mission + training Bug #4701: PrisonMarker record is not hardcoded like other markers Bug #4703: Editor: it's possible to preview levelled list records