From bb7b95023fb2af9a9055b940bbc4aec97790e8f6 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Wed, 17 Oct 2018 14:31:43 +0100 Subject: [PATCH] Bug 2009: Windows+Linux: Intermittent truncation of the end of a recording Problem: up to about 300ms was intermittently truncated from the end of recording. The bug was introduced by commit a0256e9. The fix: in this commit, the line: the line: mRecordingSchedule = {}; // free arrays was added to the lambda in the definition of cleanup at the start of AudioIO::StopStream() If this line is changed to: mRecordingSchedule.mCrossfadeData.clear(); // free arrays then this has been found to fix the bug, and the vector is still cleared. Clearly, the reinitialization of one or more of the other data members of mRecordingSchedule was causing the bug. Which of the these reinitializations are the problem, and why is not known, and due to the nature of the problem could well take some time to find out. --- src/AudioIO.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index 77a230a24..76af9979f 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -2413,7 +2413,7 @@ void AudioIO::StopStream() { auto cleanup = finally ( [this] { ClearRecordingException(); - mRecordingSchedule = {}; // free arrays + mRecordingSchedule.mCrossfadeData.clear(); // free arrays } ); if( mPortStreamV19 == NULL