Avoid RatioMostlyFixed in RealTime mode, it can lead to unpleasant surprises

This commit is contained in:
Chris Cannam
2022-08-02 16:22:24 +01:00
parent d211121701
commit 9fff2836c6

View File

@@ -276,14 +276,12 @@ R3Stretcher::createResampler()
resamplerParameters.maxBufferSize = m_guideConfiguration.longestFftSize;
if (isRealTime()) {
if (m_parameters.options &
RubberBandStretcher::OptionPitchHighConsistency) {
resamplerParameters.dynamism = Resampler::RatioOftenChanging;
resamplerParameters.ratioChange = Resampler::SmoothRatioChange;
} else {
resamplerParameters.dynamism = Resampler::RatioMostlyFixed;
resamplerParameters.ratioChange = Resampler::SmoothRatioChange;
}
// If we knew the caller would never change ratio, we could
// supply RatioMostlyFixed - but it can have such overhead
// when the ratio *does* change that a single call would kill
// RT use, so it's not a good idea
resamplerParameters.dynamism = Resampler::RatioOftenChanging;
resamplerParameters.ratioChange = Resampler::SmoothRatioChange;
} else {
resamplerParameters.dynamism = Resampler::RatioMostlyFixed;
resamplerParameters.ratioChange = Resampler::SuddenRatioChange;