Fixed realtime audio not working correctly at emulation speeds over 100%

This commit is contained in:
OpenSauce04 2024-06-30 17:33:08 +01:00
parent 335fedaffe
commit 37e46358ea

View File

@ -419,7 +419,8 @@ void DspHle::Impl::AudioTickCallback(s64 cycles_late) {
// Reschedule recurrent event
const double time_scale =
Settings::values.enable_realtime_audio
? std::clamp(Core::System::GetInstance().GetStableFrameTimeScale(), 1.0, 3.0)
? std::clamp(Core::System::GetInstance().GetStableFrameTimeScale(),
100. / Settings::values.frame_limit.GetValue(), 3.0)
: 1.0;
s64 adjusted_ticks = static_cast<s64>(audio_frame_ticks / time_scale - cycles_late);
core_timing.ScheduleEvent(adjusted_ticks, tick_event);