MIDI/Windows: Return early from MPU_Init if MPU_Reset was not previously called to shut the MPU down.

git-svn-id: https://svn.eduke32.com/eduke32@6782 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2018-03-22 04:48:54 +00:00
parent bb84fa725e
commit eee1fd6e2c

View file

@ -257,6 +257,7 @@ int32_t MPU_Reset
{ {
midiStreamStop(hmido); midiStreamStop(hmido);
midiStreamClose(hmido); midiStreamClose(hmido);
hmido = (HMIDISTRM)-1;
return MPU_Ok; return MPU_Ok;
} }
@ -274,6 +275,9 @@ int32_t MPU_Init
) )
{ {
if (hmido != (HMIDISTRM)-1)
return MPU_Ok;
int32_t i; int32_t i;
for (i=0; i<NUMBUFFERS; i++) eventcnt[i]=0; for (i=0; i<NUMBUFFERS; i++) eventcnt[i]=0;