mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-14 07:07:56 -05:00
Avoid (expensive) audio interpolation when sample rates already match
This commit is contained in:
@ -285,8 +285,11 @@ void AudioRenderer::VoiceState::RefreshBuffer() {
|
||||
break;
|
||||
}
|
||||
|
||||
samples =
|
||||
Interpolate(interp_state, std::move(samples), GetInfo().sample_rate, STREAM_SAMPLE_RATE);
|
||||
// Only interpolate when necessary, expensive.
|
||||
if (GetInfo().sample_rate != STREAM_SAMPLE_RATE) {
|
||||
samples = Interpolate(interp_state, std::move(samples), GetInfo().sample_rate,
|
||||
STREAM_SAMPLE_RATE);
|
||||
}
|
||||
|
||||
is_refresh_pending = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user