android: audio: Audio stretching is only useful with lower framerates, disable it when fullspeed.
This commit is contained in:
parent
8a482e3f62
commit
8fbbfab749
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <android/native_window_jni.h>
|
#include <android/native_window_jni.h>
|
||||||
|
|
||||||
|
#include "audio_core/dsp_interface.h"
|
||||||
#include "common/file_util.h"
|
#include "common/file_util.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/microprofile.h"
|
#include "common/microprofile.h"
|
||||||
@ -167,6 +168,20 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
|
|||||||
|
|
||||||
SCOPE_EXIT({ TryShutdown(); });
|
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) {
|
||||||
|
Core::DSP().EnableStretching(Core::System::GetInstance().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 (is_running) {
|
while (is_running) {
|
||||||
if (!pause_emulation) {
|
if (!pause_emulation) {
|
||||||
system.RunLoop();
|
system.RunLoop();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user