diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index 6ce02ca2d..76542bdb6 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -4224,8 +4224,8 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer, (int)framesPerBuffer); chanCnt++; } - // There should not be a difference of len in different loop passes... - // but anyway take a max. + // There can be a difference of len in different loop passes if one channel + // of a stereo track ends before the other! Take a max! maxLen = std::max(maxLen, len); @@ -4257,6 +4257,9 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer, } #endif + // Last channel seen now + len = maxLen; + if( !cut && selected ) { len = em.RealtimeProcess(group, chanCnt, tempBufs, len);