MixerAudioSource locks with 3+ sources [fixed]


#1

Hi.  I'm attempting to build a basic multitrack program using MixerAudioSource.

I have 3 wav files being loaded into separate AudioFormatReader -> AudioFormatReaderSource -> AudioTransportSource.

I'm using MixerAudioSource.addInputSource() 3 times to add each of the TransportSources and then setting the MixerAudioSource as the source of an AudioSourcePlayer.

When I add this AudioSourcePlayer as the audio callback to the AudioDeviceManager, it hangs.

In the juce_BufferingAudioSource's prepareToPlay() function, the while loop at the bottom runs endlessly because bufferValidEnd is always 0. 

If I only add 2 tracks, it works perfectly.  Adding the 3rd track causes the endless loop.

Can anyone point me in the direction of what I'm doing wrong?

Thanks.

Dave

** FIXED: I had separate threads on the TransportSources and once I removed them, it worked.  BTW, any suggestions on how to optimize this approach would be appreciated...