1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-06 17:13:49 +01:00

Bug 2045 - Clicky playback with Play-at-Speed and Scrubbing/Seeking

This commit is contained in:
James Crook
2018-12-03 21:04:50 +00:00
parent bd2547828e
commit 0eb778631b
3 changed files with 6 additions and 4 deletions

View File

@@ -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 =

View File

@@ -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)

View File

@@ -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);