From 9b97f504bbb335d92d5dc41d17d5c7bdc12d1319 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 20 Oct 2019 11:41:41 +0000 Subject: [PATCH] Fix issue with tempo when changing back and forth between OPL3 and WinMM MIDI output git-svn-id: https://svn.eduke32.com/eduke32@8236 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/audiolib/src/driver_winmm.cpp | 2 ++ source/audiolib/src/midi.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/audiolib/src/driver_winmm.cpp b/source/audiolib/src/driver_winmm.cpp index 58916e989..87a93b948 100644 --- a/source/audiolib/src/driver_winmm.cpp +++ b/source/audiolib/src/driver_winmm.cpp @@ -737,6 +737,8 @@ int WinMMDrv_MIDI_StartPlayback(void (*service)(void)) return WinMMErr_Error; } + midiLastDivision = 0; + return WinMMErr_Ok; } diff --git a/source/audiolib/src/midi.cpp b/source/audiolib/src/midi.cpp index 60ff56f66..c9be779af 100644 --- a/source/audiolib/src/midi.cpp +++ b/source/audiolib/src/midi.cpp @@ -776,12 +776,12 @@ int MIDI_PlaySong(char *song, int loopflag) _MIDI_Reset = FALSE; - MIDI_SetTempo(120); - // this can either stay like this, or I can add another field to the MIDI driver spec that holds the service callback if (SoundDriver_MIDI_StartPlayback(ASS_MIDISoundDriver == ASS_OPL3 ? _MIDI_ServiceMultivoc : _MIDI_ServiceRoutine) != MIDI_Ok) return MIDI_DriverError; + MIDI_SetTempo(120); + _MIDI_SongLoaded = TRUE; _MIDI_SongActive = TRUE;