mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-28 14:18:41 +02:00
Set the playback RingBuffer latency appropriately for seeking
This commit is contained in:
parent
111d2c8673
commit
5cfbfd364e
@ -2254,8 +2254,10 @@ bool AudioIO::AllocateBuffers(
|
|||||||
// thread, in many smaller pieces.
|
// thread, in many smaller pieces.
|
||||||
double playbackTime = 4.0;
|
double playbackTime = 4.0;
|
||||||
if (scrubbing)
|
if (scrubbing)
|
||||||
|
// Specify a very short minimum batch for non-seek scrubbing, to allow
|
||||||
|
// more frequent polling of the mouse
|
||||||
playbackTime =
|
playbackTime =
|
||||||
lrint(options.pScrubbingOptions->delay * mRate) / mRate;
|
lrint(options.pScrubbingOptions->delay * mRate) / mRate;
|
||||||
|
|
||||||
wxASSERT( playbackTime >= 0 );
|
wxASSERT( playbackTime >= 0 );
|
||||||
mPlaybackSamplesToCopy = playbackTime * mRate;
|
mPlaybackSamplesToCopy = playbackTime * mRate;
|
||||||
@ -2294,6 +2296,13 @@ bool AudioIO::AllocateBuffers(
|
|||||||
Mixer::WarpOptions(mPlaybackSchedule.mTimeTrack);
|
Mixer::WarpOptions(mPlaybackSchedule.mTimeTrack);
|
||||||
|
|
||||||
mPlaybackQueueMinimum = mPlaybackSamplesToCopy;
|
mPlaybackQueueMinimum = mPlaybackSamplesToCopy;
|
||||||
|
if (scrubbing)
|
||||||
|
// Specify enough playback RingBuffer latency so we can refill
|
||||||
|
// once every seek stutter without falling behind the demand.
|
||||||
|
// (Scrub might switch in and out of seeking with left mouse
|
||||||
|
// presses in the ruler)
|
||||||
|
mPlaybackQueueMinimum = lrint(
|
||||||
|
2 * options.pScrubbingOptions->minStutterTime * mRate );
|
||||||
mPlaybackQueueMinimum =
|
mPlaybackQueueMinimum =
|
||||||
std::min( mPlaybackQueueMinimum, playbackBufferSize );
|
std::min( mPlaybackQueueMinimum, playbackBufferSize );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user