Hold global lock during mixing only when iterating device contexts

This commit is contained in:
Chris Robinson 2010-01-11 03:57:49 -08:00
parent ac9c2e8c4a
commit 1a57f095e8

View File

@ -1247,8 +1247,6 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
int fpuState; int fpuState;
ALuint i, c; ALuint i, c;
SuspendContext(NULL);
#if defined(HAVE_FESETROUND) #if defined(HAVE_FESETROUND)
fpuState = fegetround(); fpuState = fegetround();
fesetround(FE_TOWARDZERO); fesetround(FE_TOWARDZERO);
@ -1268,6 +1266,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
/* Clear mixing buffer */ /* Clear mixing buffer */
memset(DryBuffer, 0, SamplesToDo*OUTPUTCHANNELS*sizeof(ALfloat)); memset(DryBuffer, 0, SamplesToDo*OUTPUTCHANNELS*sizeof(ALfloat));
SuspendContext(NULL);
for(c = 0;c < device->NumContexts;c++) for(c = 0;c < device->NumContexts;c++)
{ {
ALContext = device->Contexts[c]; ALContext = device->Contexts[c];
@ -1288,6 +1287,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
} }
ProcessContext(ALContext); ProcessContext(ALContext);
} }
ProcessContext(NULL);
//Post processing loop //Post processing loop
ChanMap = device->DevChannels; ChanMap = device->DevChannels;
@ -1396,8 +1396,6 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
#elif defined(HAVE__CONTROLFP) #elif defined(HAVE__CONTROLFP)
_controlfp(fpuState, 0xfffff); _controlfp(fpuState, 0xfffff);
#endif #endif
ProcessContext(NULL);
} }
ALvoid aluHandleDisconnect(ALCdevice *device) ALvoid aluHandleDisconnect(ALCdevice *device)