- stop/play mp3 decoding as needed: That is the main thread called engine
controls mp3 playback via a flag maybe (inter-thread communication).
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.
Reza