summaryrefslogtreecommitdiffstats
path: root/src/audio_core/algorithm/interpolate.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-10-14 00:30:30 +0200
committerGitHub <noreply@github.com>2020-10-14 00:30:30 +0200
commitca416a0fb87ced0e471729fe344b9f34a090e7b5 (patch)
treed1a143eb839744bc1515700c861ec7e5d04d130e /src/audio_core/algorithm/interpolate.cpp
parentMerge pull request #4786 from lioncash/flags (diff)
parentaudio_core/CMakeLists: Make warnings consistent with core (diff)
downloadyuzu-ca416a0fb87ced0e471729fe344b9f34a090e7b5.tar
yuzu-ca416a0fb87ced0e471729fe344b9f34a090e7b5.tar.gz
yuzu-ca416a0fb87ced0e471729fe344b9f34a090e7b5.tar.bz2
yuzu-ca416a0fb87ced0e471729fe344b9f34a090e7b5.tar.lz
yuzu-ca416a0fb87ced0e471729fe344b9f34a090e7b5.tar.xz
yuzu-ca416a0fb87ced0e471729fe344b9f34a090e7b5.tar.zst
yuzu-ca416a0fb87ced0e471729fe344b9f34a090e7b5.zip
Diffstat (limited to 'src/audio_core/algorithm/interpolate.cpp')
-rw-r--r--src/audio_core/algorithm/interpolate.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/audio_core/algorithm/interpolate.cpp b/src/audio_core/algorithm/interpolate.cpp
index 689a54508..699fcb84c 100644
--- a/src/audio_core/algorithm/interpolate.cpp
+++ b/src/audio_core/algorithm/interpolate.cpp
@@ -146,7 +146,7 @@ std::vector<s16> Interpolate(InterpolationState& state, std::vector<s16> input,
return {};
if (ratio <= 0) {
- LOG_CRITICAL(Audio, "Nonsensical interpolation ratio {}", ratio);
+ LOG_ERROR(Audio, "Nonsensical interpolation ratio {}", ratio);
return input;
}
@@ -164,7 +164,8 @@ std::vector<s16> Interpolate(InterpolationState& state, std::vector<s16> input,
const std::size_t num_frames{input.size() / 2};
std::vector<s16> output;
- output.reserve(static_cast<std::size_t>(input.size() / ratio + InterpolationState::taps));
+ output.reserve(static_cast<std::size_t>(static_cast<double>(input.size()) / ratio +
+ InterpolationState::taps));
for (std::size_t frame{}; frame < num_frames; ++frame) {
const std::size_t lut_index{(state.fraction >> 8) * InterpolationState::taps};