I’m trying to play several audio files thru AudioTransportSource. Some are in loop, some are playing, some are in stop etc…
But when I stop one of them that was playing, there’s some kind of freeze happening, with all tracks being muted.
I guess it could be related to the Thread::sleep (2); bellow ?
[code]void AudioTransportSource::stop()
{
if (playing)
{
{
const ScopedLock sl (callbackLock);
playing = false;
}
int n = 500;
while (--n >= 0 && ! stopped)
Thread::sleep (2);
sendChangeMessage();
}
Well that method blocks until the audio thread has stopped playing, there’s nothing wrong with the way it’s written… If you’re getting a deadlock, then your audio thread must be blocked waiting for something. Surely it’s obvious to see what’s happening in your debugger?
I was calling stop() from within the audio processing chain.
Using a ChangeListener and ChangeMessage to trigger stop() works fine, so I’ll just use that, since I’m not concerned about sample precision here.