Fixed bug #807
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Sep 2009 10:49:30 +0000
changeset 399a5181f588b96
parent 398 15acba767487
child 400 bc35cb13c14b
Fixed bug #807

O.Sezer 2009-09-26 03:43:47 PDT

W32 version of native_midi_detect() does midiStreamClose(MidiStream) where
MidiStream can be set to 0 just a line above. The attached patch fixes it.
native_midi/native_midi_win32.c
     1.1 --- a/native_midi/native_midi_win32.c	Sat Sep 26 09:21:38 2009 +0000
     1.2 +++ b/native_midi/native_midi_win32.c	Sat Sep 26 10:49:30 2009 +0000
     1.3 @@ -183,12 +183,9 @@
     1.4  
     1.5    merr=midiStreamOpen(&MidiStream,&MidiDevice,(DWORD)1,(DWORD_PTR)MidiProc,(DWORD_PTR)0,CALLBACK_FUNCTION);
     1.6    if (merr!=MMSYSERR_NOERROR)
     1.7 -    MidiStream=0;
     1.8 +    return 0;
     1.9    midiStreamClose(MidiStream);
    1.10 -  if (!MidiStream)
    1.11 -    return 0;
    1.12 -  else
    1.13 -    return 1;
    1.14 +  return 1;
    1.15  }
    1.16  
    1.17  NativeMidiSong *native_midi_loadsong(char *midifile)