From d012f65d4f38c90296c78479ea39d345024d383d Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 29 Jul 2022 22:16:22 +1000 Subject: [PATCH] AudioStream: Fix possible NaN in forced tempo update --- src/util/audio_stream.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/audio_stream.cpp b/src/util/audio_stream.cpp index 6dba456c3..12ed857c4 100644 --- a/src/util/audio_stream.cpp +++ b/src/util/audio_stream.cpp @@ -279,6 +279,9 @@ void AudioStream::UpdateTargetTempo(float tempo) std::fill_n(m_average_fullness.data(), AVERAGING_WINDOW, tempo); m_soundtouch->setTempo(tempo); m_stretch_reset = 0; + m_stretch_inactive = false; + m_stretch_ok_count = 0; + m_dynamic_target_usage = static_cast(m_target_buffer_size) * m_nominal_rate; } void AudioStream::SetStretchMode(AudioStretchMode mode)