On Wed, Jul 24, 2002 at 11:11:33PM -0700, Reza Naima wrote:
What I do to pause is to have the output callback check to see if a "PLAY" flag is set. If it is set, then to copy the decoded audio to the audio device (/dev/dsp). If it is not set, then to sleep (actually, a select() loop with a timeout as sleep() causes all your threads to sleep). Then check the thread again after some time to see if it has been turned on, in which case, you resume your normal operation.
Using a condition variable is most likly much better than busy waiting. Most threading systems have built in condition vars.