mirror of https://github.com/OpenTTD/OpenTTD
(svn r2730) -Fix: Fail if the sequencer can't play audio
Also check the return value of CreateThread()release/0.4.5
parent
2ff85cdc56
commit
e2ce1f997a
|
@ -126,11 +126,18 @@ static DWORD WINAPI MidiThread(LPVOID arg)
|
||||||
static const char *Win32MidiStart(const char * const *parm)
|
static const char *Win32MidiStart(const char * const *parm)
|
||||||
{
|
{
|
||||||
DWORD threadId;
|
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));
|
memset(&_midi, 0, sizeof(_midi));
|
||||||
_midi.new_vol = -1;
|
_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)
|
static void Win32MidiStop(void)
|
||||||
|
|
Loading…
Reference in New Issue