aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/dsound.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-03-01 00:57:37 -0800
committerChris Robinson <[email protected]>2008-03-01 00:57:37 -0800
commit2b42d7fdb8181ae5c721e86cc9bf5896e546cc02 (patch)
tree107c4f073f7d28ee2f2dace73fc6e9ef8be5692b /Alc/dsound.c
parent9b3c4faa344d5d678b463b3cfa7ba958436dbf85 (diff)
Don't start the DSound playback thread is startup failed
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r--Alc/dsound.c11
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))
{