aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-08-07 09:13:51 -0700
committerChris Robinson <[email protected]>2010-08-07 09:13:51 -0700
commitdf822513fa9656f1a0fea1ef3f895f7ec5cee48c (patch)
treeefd4cb11fc659eef66c1799e93a451a5243ec738
parent762bdaeee1d87ff94102093695804fd3b03b8c74 (diff)
Don't re-init and re-allocate some stuff when the device is left running
-rw-r--r--Alc/ALc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 02de6ce0..2a27b34e 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1559,7 +1559,10 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
device->NumAuxSends = numSends;
}
- if(running == AL_FALSE && ALCdevice_ResetPlayback(device) == ALC_FALSE)
+ if(running != AL_FALSE)
+ goto make_context;
+
+ if(ALCdevice_ResetPlayback(device) == ALC_FALSE)
{
alcSetError(device, ALC_INVALID_DEVICE);
aluHandleDisconnect(device);
@@ -1638,6 +1641,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
else
device->HeadDampen = 0.0f;
+make_context:
temp = realloc(device->Contexts, (device->NumContexts+1) * sizeof(*device->Contexts));
if(!temp)
{