aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-08-26 19:15:17 -0700
committerChris Robinson <[email protected]>2009-08-26 19:15:17 -0700
commit7976de05a54fb84c575723d77465308e49c9a258 (patch)
tree5ea263be25c5bcafbc06a29e5c04ebf4e5a7a56d /OpenAL32/alSource.c
parent70c88879abaa7f4946dc009770bf23fab3f2ee48 (diff)
Add base support for ALC_EXT_disconnect
Individual backends need to be updated to handle disconnection events
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 205a1c46..30be074e 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -1347,6 +1347,22 @@ ALAPI ALvoid ALAPIENTRY alSourcePlayv(ALsizei n, const ALuint *pSourceList)
// Check if an Offset has been set
if(pSource->lOffset)
ApplyOffset(pSource, AL_FALSE);
+
+ // If device is disconnected, go right to stopped
+ if(!pContext->Device->Connected)
+ {
+ pSource->state = AL_STOPPED;
+ pSource->inuse = AL_FALSE;
+ pSource->BuffersPlayed = pSource->BuffersInQueue;
+ ALBufferList = pSource->queue;
+ while(ALBufferList != NULL)
+ {
+ ALBufferList->bufferstate = PROCESSED;
+ ALBufferList = ALBufferList->next;
+ }
+ pSource->position = 0;
+ pSource->position_fraction = 0;
+ }
}
else
{