From 0b5e35003fd921d5a1788d85b2909da94a4acaf4 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 31 Jan 2016 15:19:47 -0500 Subject: [PATCH] Bug1104: When one stereo channel is shorter, don't stop playback at its end. --- src/AudioIO.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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);