summaryrefslogtreecommitdiffstats
path: root/src/audio_core/audio_renderer.cpp
diff options
context:
space:
mode:
authorheapo <heapo3@gmail.com>2018-12-06 18:15:47 +0100
committerheapo <heapo3@gmail.com>2018-12-06 18:46:08 +0100
commit117b1f3ec1bae4d9be68cf401f739fc7d35fcc40 (patch)
tree1baa2c45bf3c1f63b0820a10ef8cae69c410bcd4 /src/audio_core/audio_renderer.cpp
parentMerge pull request #1824 from ReinUsesLisp/fbcache (diff)
downloadyuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar
yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.gz
yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.bz2
yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.lz
yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.xz
yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.tar.zst
yuzu-117b1f3ec1bae4d9be68cf401f739fc7d35fcc40.zip
Diffstat (limited to 'src/audio_core/audio_renderer.cpp')
-rw-r--r--src/audio_core/audio_renderer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp
index 2e59894ab..2683f3a5f 100644
--- a/src/audio_core/audio_renderer.cpp
+++ b/src/audio_core/audio_renderer.cpp
@@ -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;
}