diff options
author | Chris Robinson <[email protected]> | 2008-03-01 00:57:37 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-03-01 00:57:37 -0800 |
commit | 2b42d7fdb8181ae5c721e86cc9bf5896e546cc02 (patch) | |
tree | 107c4f073f7d28ee2f2dace73fc6e9ef8be5692b /Alc/dsound.c | |
parent | 9b3c4faa344d5d678b463b3cfa7ba958436dbf85 (diff) |
Don't start the DSound playback thread is startup failed
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r-- | Alc/dsound.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c index 61be8f44..fa0af41c 100644 --- a/Alc/dsound.c +++ b/Alc/dsound.c @@ -275,10 +275,13 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam if(SUCCEEDED(hr)) hr = IDirectSoundBuffer_Play(pData->DSsbuffer, 0, 0, DSBPLAY_LOOPING); - device->ExtraData = pData; - pData->thread = StartThread(DSoundProc, device); - if(!pData->thread) - hr = E_FAIL; + if(SUCCEEDED(hr)) + { + device->ExtraData = pData; + pData->thread = StartThread(DSoundProc, device); + if(!pData->thread) + hr = E_FAIL; + } if(FAILED(hr)) { |