Properly lock the device when setting it disconnected

This commit is contained in:
Chris Robinson
2009-11-01 09:29:20 -08:00
parent 5aed927887
commit fb258a7416
2 changed files with 2 additions and 4 deletions
+2
View File
@@ -1362,6 +1362,7 @@ ALvoid aluHandleDisconnect(ALCdevice *device)
{
ALuint i;
SuspendContext(NULL);
for(i = 0;i < device->NumContexts;i++)
{
ALsource *source;
@@ -1384,4 +1385,5 @@ ALvoid aluHandleDisconnect(ALCdevice *device)
}
device->Connected = ALC_FALSE;
ProcessContext(NULL);
}
-4
View File
@@ -266,9 +266,7 @@ static void context_state_callback2(pa_context *context, void *pdata) //{{{
if(ppa_context_get_state(context) == PA_CONTEXT_FAILED)
{
AL_PRINT("Received context failure!\n");
SuspendContext(NULL);
aluHandleDisconnect(Device);
ProcessContext(NULL);
}
}//}}}
@@ -279,9 +277,7 @@ static void stream_state_callback2(pa_stream *stream, void *pdata) //{{{
if(ppa_stream_get_state(stream) == PA_STREAM_FAILED)
{
AL_PRINT("Received stream failure!\n");
SuspendContext(NULL);
aluHandleDisconnect(Device);
ProcessContext(NULL);
}
}//}}}