aboutsummaryrefslogtreecommitdiffstats
path: root/core/converter.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-11-13 14:13:33 -0800
committerChris Robinson <[email protected]>2022-11-13 14:13:33 -0800
commit543660f1a7c03634c6bec184a47dfd7c9845f17f (patch)
tree4edf908ebf2469c62250b953f290384c28ced911 /core/converter.h
parentc45843964bc461cbf5f99ec651bd8c07fbb14b35 (diff)
Avoid a potential unsigned underflow
Diffstat (limited to 'core/converter.h')
-rw-r--r--core/converter.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/converter.h b/core/converter.h
index b6ff3ba5..01becea2 100644
--- a/core/converter.h
+++ b/core/converter.h
@@ -41,7 +41,7 @@ struct SampleConverter {
using SampleOffset = std::chrono::duration<int64_t, std::ratio<1,MixerFracOne>>;
SampleOffset currentInputDelay() const noexcept
{
- const int64_t prep{mSrcPrepCount - MaxResamplerEdge};
+ const int64_t prep{int64_t{mSrcPrepCount} - MaxResamplerEdge};
return SampleOffset{(prep<<MixerFracBits) + mFracOffset};
}