diff options
author | Chris Robinson <[email protected]> | 2009-08-11 07:57:18 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-08-11 07:57:18 -0700 |
commit | 4ee3972f151ac979473d35b6e7933794dacf801c (patch) | |
tree | 64e58ab67a473218e44d51fd71c8b677d17c01c9 /OpenAL32 | |
parent | 00a9cf4a8506fbfe181cd165c2257ef7f8db5ec3 (diff) |
Update queued buffer states when source looping is toggled
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/alSource.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 99fb5f06..9ab0e43a 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -532,6 +532,7 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) ALCcontext *pContext; ALsource *pSource; ALbufferlistitem *pALBufferListItem; + ALuint i; pContext = alcGetCurrentContext(); if (pContext) @@ -573,7 +574,19 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) case AL_LOOPING: if ((lValue == AL_FALSE) || (lValue == AL_TRUE)) + { pSource->bLooping = (ALboolean)lValue; + + pALBufferListItem = pSource->queue; + for(i = 0;pALBufferListItem != NULL;i++) + { + if(lValue == AL_FALSE && i <= pSource->BuffersPlayed) + pALBufferListItem->bufferstate = PROCESSED; + else + pALBufferListItem->bufferstate = PENDING; + pALBufferListItem = pALBufferListItem->next; + } + } else alSetError(AL_INVALID_VALUE); break; |