BufferingAudioSource position not updated

Hi,

I’m using the AudioTransportSource with a read-ahead, but I got this problem: in order to synchronize playback between different audio files, I use getNextReadPosition. But sometimes, the read position isn’t updated, so one of the audio files is delayed in relation to the others.

The problem is that if BufferingAudioSource::getNextAudioBlock finds that there is no valid audio data at all in the buffer, it returns without incrementing nextPlayPos:

    if (bufferRange.isEmpty())
    {
        // total cache miss
        info.clearActiveBufferRegion();
        return;
    }

Is this intended behavior? Otherwise, a simple fix would be to increment nextPlayPos before returning:

    if (bufferRange.isEmpty())
    {
        // total cache miss
        info.clearActiveBufferRegion();
        nextPlayPos += info.numSamples;  // Time still passes...
        return;
    }

Erik