From a0fd0f506c2ed17fd7cd70aacd65217b8ad1e8a8 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sun, 22 Mar 2020 19:23:23 +0000 Subject: [PATCH] Revert fix for 2288 - Unintended consequences. This fix was causing extra clips at the ends of tracks. --- src/WaveClip.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WaveClip.cpp b/src/WaveClip.cpp index 4c32e0845..0182031b2 100644 --- a/src/WaveClip.cpp +++ b/src/WaveClip.cpp @@ -459,7 +459,7 @@ sampleCount WaveClip::GetNumSamples() const bool WaveClip::WithinClip(double t) const { auto ts = (sampleCount)floor(t * mRate + 0.5); - return ts > GetStartSample() && ts <= GetEndSample() + mAppendBufferLen; + return ts > GetStartSample() && ts < GetEndSample() + mAppendBufferLen; } bool WaveClip::BeforeClip(double t) const @@ -471,7 +471,7 @@ bool WaveClip::BeforeClip(double t) const bool WaveClip::AfterClip(double t) const { auto ts = (sampleCount)floor(t * mRate + 0.5); - return ts > GetEndSample() + mAppendBufferLen; + return ts >= GetEndSample() + mAppendBufferLen; } // A sample at time t could be in the clip, but