summaryrefslogtreecommitdiff
path: root/src/soundmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/soundmanager.cpp')
-rw-r--r--src/soundmanager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/soundmanager.cpp b/src/soundmanager.cpp
index 558e4e12c..b60e84ef3 100644
--- a/src/soundmanager.cpp
+++ b/src/soundmanager.cpp
@@ -232,11 +232,14 @@ static SDLMusic *loadMusic(const std::string &fileName)
void SoundManager::playMusic(const std::string &fileName)
{
- mCurrentMusicFile = fileName;
-
if (!mInstalled || !mPlayMusic)
return;
+ if (mCurrentMusicFile == fileName)
+ return;
+
+ mCurrentMusicFile = fileName;
+
haltMusic();
if (!fileName.empty())
@@ -407,6 +410,7 @@ void SoundManager::haltMusic()
mMusic->decRef();
mMusic = nullptr;
}
+ mCurrentMusicFile.clear();
}
void SoundManager::changeAudio()