diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index fd0363c13..4fbfd4147 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -5543,7 +5543,8 @@ PaStreamCallbackResult AudioIoCallback::CallbackDoSeek() // Reset mixer positions and flush buffers for all tracks for (size_t i = 0; i < numPlaybackTracks; i++) { - mPlaybackMixers[i]->Reposition( time ); + const bool skipping = true; + mPlaybackMixers[i]->Reposition( time, skipping ); const auto toDiscard = mPlaybackBuffers[i]->AvailForGet(); const auto discarded = diff --git a/src/Mix.cpp b/src/Mix.cpp index 7ecbcb41d..1621cec64 100644 --- a/src/Mix.cpp +++ b/src/Mix.cpp @@ -710,7 +710,7 @@ void Mixer::Restart() MakeResamplers(); } -void Mixer::Reposition(double t) +void Mixer::Reposition(double t, bool bSkipping) { mTime = t; const bool backwards = (mT1 < mT0); @@ -729,7 +729,8 @@ void Mixer::Reposition(double t) // constant rate resampling if you try to reuse the resampler after it has // flushed. Should that be considered a bug in sox? This works around it. // (See also bug 1887, and the same work around in Mixer::Restart().) - MakeResamplers(); + if( bSkipping ) + MakeResamplers(); } void Mixer::SetTimesAndSpeed(double t0, double t1, double speed) diff --git a/src/Mix.h b/src/Mix.h index 394f45910..59e319fe7 100644 --- a/src/Mix.h +++ b/src/Mix.h @@ -131,7 +131,7 @@ class AUDACITY_DLL_API Mixer { /// Reposition processing to absolute time next time /// Process() is called. - void Reposition(double t); + void Reposition(double t, bool bSkipping = false); // Used in scrubbing. void SetTimesAndSpeed(double t0, double t1, double speed);