From: Tobias Markus Date: Sun, 25 Aug 2013 10:19:51 +0000 (+0200) Subject: Prevent previous music from playing when sound file couldn't be found X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ccbdf3a3f15d24ad65d40907b4e99f4582c7ae38;p=supertux.git Prevent previous music from playing when sound file couldn't be found --- diff --git a/src/audio/sound_manager.cpp b/src/audio/sound_manager.cpp index a7f32d864..89f86b21d 100644 --- a/src/audio/sound_manager.cpp +++ b/src/audio/sound_manager.cpp @@ -305,6 +305,8 @@ SoundManager::play_music(const std::string& filename, bool fade) music_source = newmusic.release(); } catch(std::exception& e) { log_warning << "Couldn't play music file '" << filename << "': " << e.what() << std::endl; + // When this happens, previous music continued playing, stop it, just in case. + stop_music(0); } }