Libretro: Do not adjust sample rate for audio (fixes sound regression)

This commit is contained in:
Sour 2018-06-17 23:07:57 -04:00
parent d612c6a4cb
commit e18fab0557

View file

@ -204,11 +204,13 @@ void SoundMixer::UpdateRates(bool forceUpdate)
AudioStatistics stats = GetStatistics(); AudioStatistics stats = GetStatistics();
int32_t requestedLatency = (int32_t)EmulationSettings::GetAudioLatency(); int32_t requestedLatency = (int32_t)EmulationSettings::GetAudioLatency();
double targetRate = _sampleRate; double targetRate = _sampleRate;
if(stats.AverageLatency > 0 && EmulationSettings::GetEmulationSpeed(100)) {
if(stats.AverageLatency > requestedLatency + 2) { if(stats.AverageLatency > requestedLatency + 2) {
targetRate *= 1.005; targetRate *= 1.005;
} else if(stats.AverageLatency < requestedLatency - 2) { } else if(stats.AverageLatency < requestedLatency - 2) {
targetRate *= 0.995; targetRate *= 0.995;
} }
}
if(_clockRate != newRate || forceUpdate) { if(_clockRate != newRate || forceUpdate) {
_clockRate = newRate; _clockRate = newRate;