Race Condition With Irregular Streaming

Ben Supnik <[email protected]>
Newsgroups gmane.comp.lib.openal
Message-ID <[email protected]>
Hi Y'all,

My app plays audio messages through a source by enqueueing one or more 
buffers to a source (e.g. a streaming model).

Here's the problem: since my messages are generated semi-randomly by the 
game, I might go to enqueue the next message just before or just after 
the source under-runs and stops itself.

My concern is that I might check the source status (to see if it's 
playing) and then have it stop just _after_ the check.

At this point, the source needs a "play" call, but I don't know that, 
and my newly queued sound isn't actually running.

If I simply play the source all of the time and there is still pending 
work to be done, I will restart the old messages.

Is there a race-condition-free way to write this logic?  Or do I need to 
poll the channel for under-run periodically to catch any "full stops" 
that I missed?

Thanks!
Ben

-- 
Scenery Home Page: http://scenery.x-plane.com/
Scenery blog: http://xplanescenery.blogspot.com/
Plugin SDK: http://www.xsquawkbox.net/xpsdk/
X-Plane Wiki: http://wiki.x-plane.com/
Scenery mailing list: [email protected]
Developer mailing list: [email protected]
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.