aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-24 17:19:52 -0700
committerChris Robinson <[email protected]>2014-05-24 17:19:52 -0700
commit3d6ffa282d6148a4e080510d88e66414abcb7b33 (patch)
treeeca06048ea7869ba7d6fe4e97d1d7d9e9ec6465f
parent4ca561acd379665b82ec9c42773aaec01df97891 (diff)
Don't resume the backend if there's no contexts
-rw-r--r--Alc/ALc.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 1b28dabb..5b26c09d 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -3675,17 +3675,18 @@ ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device)
LockLists();
if((device->Flags&DEVICE_PAUSED))
{
- if(V0(device->Backend,start)() != ALC_FALSE)
+ device->Flags &= ~DEVICE_PAUSED;
+ if(device->ContextList != NULL)
{
- device->Flags |= DEVICE_RUNNING;
- device->Flags &= ~DEVICE_PAUSED;
- }
- else
- {
- alcSetError(device, ALC_INVALID_DEVICE);
- ALCdevice_Lock(device);
- aluHandleDisconnect(device);
- ALCdevice_Unlock(device);
+ if(V0(device->Backend,start)() != ALC_FALSE)
+ device->Flags |= DEVICE_RUNNING;
+ else
+ {
+ alcSetError(device, ALC_INVALID_DEVICE);
+ ALCdevice_Lock(device);
+ aluHandleDisconnect(device);
+ ALCdevice_Unlock(device);
+ }
}
}
UnlockLists();