From 4e65e9bfa968b90c13fafe99b0d2fd2874a9191e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 11 May 2010 08:53:38 -0700 Subject: Only a streaming source can have a processed buffer --- OpenAL32/alSource.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index d9fdec0a..b9762167 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -571,8 +571,8 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) { // Source is now in UNDETERMINED mode Source->lSourceType = AL_UNDETERMINED; - Source->BuffersPlayed = 0; } + Source->BuffersPlayed = 0; // Update AL_BUFFER parameter Source->Buffer = buffer; @@ -1088,7 +1088,7 @@ AL_API ALvoid AL_APIENTRY alGetSourcei(ALuint source, ALenum eParam, ALint *plVa break; case AL_BUFFERS_PROCESSED: - if(Source->bLooping) + if(Source->bLooping || Source->lSourceType != AL_STREAMING) { /* Buffers on a looping source are in a perpetual state * of PENDING, so don't report any as PROCESSED */ @@ -1662,7 +1662,8 @@ AL_API ALvoid AL_APIENTRY alSourceUnqueueBuffers( ALuint source, ALsizei n, ALui goto done; } - if(Source->bLooping || (ALuint)n > Source->BuffersPlayed) + if(Source->bLooping || Source->lSourceType != AL_STREAMING || + (ALuint)n > Source->BuffersPlayed) { // Some buffers can't be unqueue because they have not been processed alSetError(Context, AL_INVALID_VALUE); -- cgit v1.2.3