« Return to Thread: Why does alDeleteBuffers gives a AL_INVALID_OPERATION error?

Why does alDeleteBuffers gives a AL_INVALID_OPERATION error?

by Mentalray :: Rate this Message:

Reply to Author | View in Thread

Hi,

I'm using OpenAL for an iPhone application, but I'm having a weird issue.  At some point I need to clear all of the queued buffers from one source.  Here's how I proceed (simplified version of the code):

alSourceStop( sourceId );
alGetSourcei( sourceId, AL_BUFFERS_PROCESSED, &numProcessed );
while( numProcessed-- ) {
    alSourceUnqueueBuffers( sourceId, 1, &bufferId );
    alDeleteBuffers( 1, bufferId ); // this fails with AL_INVALID_OPERATION
}

From what I understand, AL_INVALID_OPERATION is returned from alDeleteBuffers when the buffer is still in use.  This is not the case here.

I there any other things that I should check?

Any help would be appreciated,
Martin

 « Return to Thread: Why does alDeleteBuffers gives a AL_INVALID_OPERATION error?