1
0
Fork 0

(svn r2730) -Fix: Fail if the sequencer can't play audio

Also check the return value of CreateThread()
release/0.4.5
tron 2005-07-27 21:45:34 +00:00
parent 2ff85cdc56
commit e2ce1f997a
1 changed files with 9 additions and 2 deletions

View File

@ -126,11 +126,18 @@ static DWORD WINAPI MidiThread(LPVOID arg)
static const char *Win32MidiStart(const char * const *parm)
{
DWORD threadId;
char buf[16];
mciSendStringA("capability sequencer has audio", buf, lengthof(buf), 0);
if (strcmp(buf, "true") != 0) return "MCI sequencer can't play audio";
memset(&_midi, 0, sizeof(_midi));
_midi.new_vol = -1;
CreateThread(NULL, 8192, MidiThread, 0, 0, &threadId);
return 0;
if (CreateThread(NULL, 8192, MidiThread, 0, 0, &threadId) == NULL)
return "Failed to create thread";
return NULL;
}
static void Win32MidiStop(void)