From 78d28dedda05250abcef374c47fd71f14796dfbc Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 22 Mar 2012 21:09:20 +0000 Subject: [PATCH] - Fixed: S_ChangeMusic() would not necessarily restart non-looping songs that had finished playing. SVN r3462 (trunk) --- src/s_sound.cpp | 4 ++++ src/sound/music_midistream.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 726d71ef4e..8b27a5ba38 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -2379,6 +2379,10 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force) mus_playing.baseorder = order; } } + else if (!mus_playing.handle->IsPlaying()) + { + mus_playing.handle->Play(looping, order); + } return true; } diff --git a/src/sound/music_midistream.cpp b/src/sound/music_midistream.cpp index 7fb46160ff..80fd77044d 100644 --- a/src/sound/music_midistream.cpp +++ b/src/sound/music_midistream.cpp @@ -518,6 +518,10 @@ void MIDIStreamer::Stop() bool MIDIStreamer::IsPlaying() { + if (EndQueued != 0 && EndQueued < 4) + { + Stop(); + } return m_Status != STATE_Stopped; }