From 2b42d7fdb8181ae5c721e86cc9bf5896e546cc02 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 1 Mar 2008 00:57:37 -0800 Subject: Don't start the DSound playback thread is startup failed --- Alc/dsound.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Alc/dsound.c') 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)) { -- cgit v1.2.3