From 4ee3972f151ac979473d35b6e7933794dacf801c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 11 Aug 2009 07:57:18 -0700 Subject: Update queued buffer states when source looping is toggled --- OpenAL32/alSource.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenAL32') 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; -- cgit v1.2.3