# HG changeset patch # User tron # Date 2005-07-27 21:45:34 # Node ID 46691544e1af41ab15ae993757d77ef9acfeb91d # Parent a33a89b3b0b9ae522cd3e71c05f5b8745f340e7d (svn r2730) -Fix: Fail if the sequencer can't play audio Also check the return value of CreateThread() diff --git a/music/win32_m.c b/music/win32_m.c --- a/music/win32_m.c +++ b/music/win32_m.c @@ -126,11 +126,18 @@ static DWORD WINAPI MidiThread(LPVOID ar 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)