From eee1fd6e2cbc37f0c416ce7a6e73b9165a1198ea Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 22 Mar 2018 04:48:54 +0000 Subject: [PATCH] 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 --- source/duke3d/src/mpu401.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/duke3d/src/mpu401.cpp b/source/duke3d/src/mpu401.cpp index 8ffd2f620..0b0af6eb0 100644 --- a/source/duke3d/src/mpu401.cpp +++ b/source/duke3d/src/mpu401.cpp @@ -257,6 +257,7 @@ int32_t MPU_Reset { midiStreamStop(hmido); midiStreamClose(hmido); + hmido = (HMIDISTRM)-1; return MPU_Ok; } @@ -274,6 +275,9 @@ int32_t MPU_Init ) { + if (hmido != (HMIDISTRM)-1) + return MPU_Ok; + int32_t i; for (i=0; i