From e18fab05574e316ab99a219cf39efc38d86c5079 Mon Sep 17 00:00:00 2001 From: Sour Date: Sun, 17 Jun 2018 23:07:57 -0400 Subject: [PATCH] Libretro: Do not adjust sample rate for audio (fixes sound regression) --- Core/SoundMixer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Core/SoundMixer.cpp b/Core/SoundMixer.cpp index 64d00623..c4a0a788 100644 --- a/Core/SoundMixer.cpp +++ b/Core/SoundMixer.cpp @@ -204,10 +204,12 @@ void SoundMixer::UpdateRates(bool forceUpdate) AudioStatistics stats = GetStatistics(); int32_t requestedLatency = (int32_t)EmulationSettings::GetAudioLatency(); double targetRate = _sampleRate; - if(stats.AverageLatency > requestedLatency + 2) { - targetRate *= 1.005; - } else if(stats.AverageLatency < requestedLatency - 2) { - targetRate *= 0.995; + if(stats.AverageLatency > 0 && EmulationSettings::GetEmulationSpeed(100)) { + if(stats.AverageLatency > requestedLatency + 2) { + targetRate *= 1.005; + } else if(stats.AverageLatency < requestedLatency - 2) { + targetRate *= 0.995; + } } if(_clockRate != newRate || forceUpdate) {