audio_core: Only perform audio stretching if below full speed. (#7201)

This commit is contained in:
Steveice10 2023-11-26 12:06:59 -08:00 committed by GitHub
parent c0ecdb689d
commit 670e9936a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 83 additions and 52 deletions

View file

@ -202,20 +202,6 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
SCOPE_EXIT({ TryShutdown(); });
// Audio stretching on Android is only useful with lower framerates, disable it when fullspeed
Core::TimingEventType* audio_stretching_event{};
const s64 audio_stretching_ticks{msToCycles(500)};
audio_stretching_event =
system.CoreTiming().RegisterEvent("AudioStretchingEvent", [&](u64, s64 cycles_late) {
if (Settings::values.enable_audio_stretching) {
system.DSP().EnableStretching(system.GetAndResetPerfStats().emulation_speed < 0.95);
}
system.CoreTiming().ScheduleEvent(audio_stretching_ticks - cycles_late,
audio_stretching_event);
});
system.CoreTiming().ScheduleEvent(audio_stretching_ticks, audio_stretching_event);
// Start running emulation
while (!stop_run) {
if (!pause_emulation) {