[Openal-devel] Why does alDeleteBuffers gives a AL_INVALID_OPERATION error?

Martin Cote cote.martin at gmail.com
Sat Mar 21 20:14:17 PDT 2009


On Sat, Mar 21, 2009 at 1:36 PM, Chris Robinson <chris.kcat at gmail.com>wrote:

> > alSourceStop( sourceId );
> > alGetSourcei( sourceId, AL_BUFFERS_PROCESSED, &numProcessed );
> > while( numProcessed-- ) {
> >     alSourceUnqueueBuffers( sourceId, 1, &bufferId );
> >     alDeleteBuffers( 1, bufferId ); // this fails with
> AL_INVALID_OPERATION
> > }
> >
>
> That should be:
> alDeleteBuffers( 1, &bufferId );
> since it takes a pointer to a list of buffers (though since you only
> specify
> 1, it's a list of one, hence a pointer to a single buffer).


I'm sorry, I didn't transcript the original program properly.  I'm actually
passing &bufferId to the alDeleteBuffers function, but I still get the
error.

I've noticed something weird though.  If I add a sleep (I used a 1 sec
sleep) between the alSourceUnqueueBuffers and the alDeleteBuffers function,
it works fine.  The problem only seem to occur if the delete function occurs
too fast.

I'm really perplexed by this.  Does it sounds like an implementation bug?

Many thanks for your help,
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal-devel/attachments/20090321/4b775dca/attachment.html


More information about the Openal-devel mailing list