- fixed crash with non-looping music ending.

In this case it was the song terminating the stream, with the new setup the main music code has to do this itself.
This commit is contained in:
Christoph Oelckers 2019-09-30 19:41:03 +02:00
parent 83e8e5535d
commit a76cdd0946
2 changed files with 11 additions and 3 deletions

View File

@ -979,6 +979,7 @@ bool MIDIStreamer::SetSubsong(int subsong)
bool MIDIStreamer::ServiceStream(void* buff, int len)
{
if (!MIDI) return false;
return static_cast<SoftSynthMIDIDevice*>(MIDI.get())->ServiceStream(buff, len);
}

View File

@ -277,11 +277,18 @@ void S_UpdateMusic ()
// [RH] Update music and/or playlist. IsPlaying() must be called
// to attempt to reconnect to broken net streams and to advance the
// playlist when the current song finishes.
if (!mus_playing.handle->IsPlaying() && PlayList)
if (!mus_playing.handle->IsPlaying())
{
if (PlayList)
{
PlayList->Advance();
S_ActivatePlayList(false);
}
else
{
S_StopMusic(true);
}
}
}
}