aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-05-23 01:03:37 -0700
committerChris Robinson <[email protected]>2016-05-23 01:03:37 -0700
commitea83c959caddca82affb5e87bf3d50b7511199d7 (patch)
tree3e8982b2b4d7f976437a862d94af55feb5e40c6c
parente8b274d34993010462cba1086871015b3db1ccfb (diff)
Increment the device's mix count closer to the mixing loops
-rw-r--r--Alc/ALu.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index ec0dd011..b64cbf49 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1418,8 +1418,6 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
while(size > 0)
{
- IncrementRef(&device->MixCount);
-
SamplesToDo = minu(size, BUFFERSIZE);
for(c = 0;c < device->VirtOut.NumChannels;c++)
memset(device->VirtOut.Buffer[c], 0, SamplesToDo*sizeof(ALfloat));
@@ -1429,6 +1427,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
for(c = 0;c < device->FOAOut.NumChannels;c++)
memset(device->FOAOut.Buffer[c], 0, SamplesToDo*sizeof(ALfloat));
+ IncrementRef(&device->MixCount);
V0(device->Backend,lock)();
if((slot=device->DefaultSlot) != NULL)
@@ -1488,6 +1487,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
device->ClockBase += (device->SamplesDone/device->Frequency) * DEVICE_CLOCK_RES;
device->SamplesDone %= device->Frequency;
V0(device->Backend,unlock)();
+ IncrementRef(&device->MixCount);
if(device->Hrtf)
{
@@ -1590,7 +1590,6 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
}
size -= SamplesToDo;
- IncrementRef(&device->MixCount);
}
RestoreFPUMode(&oldMode);