1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 08:29:27 +02:00

Make polling loop period slightly shorter than Audio thread loop...

... but we don't need to make it as precise, using steady_clock.

Do this so that the Audio thread doesn't read the same polling message twice,
halting the scrub.  It's all right that it might miss one of the messages
instead.
This commit is contained in:
Paul Licameli 2018-08-27 13:31:36 -04:00
parent e4e7a814c8
commit 9aad60d12c
2 changed files with 5 additions and 3 deletions

View File

@ -1987,7 +1987,7 @@ int AudioIO::StartStream(const TransportTracks &tracks,
// execute too much else
if (mScrubState) {
mOwningProject->GetScrubber().ContinueScrubbingPoll();
wxMilliSleep( Scrubber::ScrubPollInterval_ms );
wxMilliSleep( Scrubber::ScrubPollInterval_ms * 0.9 );
}
else
#endif

View File

@ -51,7 +51,9 @@ enum {
ScrubSpeedStepsPerOctave = 4,
#endif
kOneSecondCountdown = 1000 / Scrubber::ScrubPollInterval_ms,
ScrubPollInterval_ms = 50,
kOneSecondCountdown = 1000 / ScrubPollInterval_ms,
};
static const double MinStutter = 0.2;
@ -632,7 +634,7 @@ void Scrubber::StartPolling()
mpThread->Run();
#endif
mPoller->Start(ScrubPollInterval_ms);
mPoller->Start(ScrubPollInterval_ms * 0.9);
}
void Scrubber::StopPolling()