From b2b5e6c793f70c424ddd347a4b32937563fed0fb Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 17 Nov 2019 01:47:50 +1000 Subject: [PATCH] HostInterface: Reset throttle timer on slowdown Prevents too slow messages when fast forwarding. --- src/core/host_interface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 0a412bb41..f74a6847a 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -141,7 +141,8 @@ void HostInterface::Throttle() m_speed_lost_time_timestamp.Reset(); } #endif - m_last_throttle_time = time - MAX_VARIANCE_TIME; + m_last_throttle_time = 0; + m_throttle_timer.Reset(); } else if (sleep_time >= MINIMUM_SLEEP_TIME && sleep_time <= m_throttle_period) { @@ -213,4 +214,6 @@ void HostInterface::UpdateSpeedLimiterState() m_audio_stream->SetSync(audio_sync_enabled); m_display->SetVSync(video_sync_enabled); + m_throttle_timer.Reset(); + m_last_throttle_time = 0; }