Restart of Mixer is same as Reposition at t0

This commit is contained in:
Paul Licameli 2018-08-08 13:53:24 -04:00
parent 46d7804cdf
commit cc08cfc9fd
1 changed files with 6 additions and 14 deletions

View File

@ -708,20 +708,7 @@ double Mixer::MixGetCurrentTime()
void Mixer::Restart()
{
mTime = mT0;
for(size_t i=0; i<mNumInputTracks; i++)
mSamplePos[i] = mInputTrack[i].GetTrack()->TimeToLongSamples(mT0);
for(size_t i=0; i<mNumInputTracks; i++) {
mQueueStart[i] = 0;
mQueueLen[i] = 0;
}
// Bug 1887: libsoxr 0.1.3, first used in Audacity 2.3.0, crashes with
// 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:
MakeResamplers();
Reposition( mT0 );
}
void Mixer::Reposition(double t)
@ -738,6 +725,11 @@ void Mixer::Reposition(double t)
mQueueStart[i] = 0;
mQueueLen[i] = 0;
}
// Bug 1887: libsoxr 0.1.3, first used in Audacity 2.3.0, crashes with
// 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:
MakeResamplers();
}
void Mixer::SetTimesAndSpeed(double t0, double t1, double speed)