diff options
-rw-r--r-- | alc/backends/coreaudio.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index 60a2c00a..9f674389 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -27,6 +27,8 @@ #include <stdlib.h> #include <string.h> +#include <cmath> + #include "alcmain.h" #include "alexcpt.h" #include "alu.h" @@ -553,7 +555,7 @@ void CoreAudioCapture::open(const ALCchar *name) * conversion ring buffer. Ensure at least 100ms for the total buffer. */ double srateScale{double{outputFormat.mSampleRate} / mDevice->Frequency}; - auto FrameCount64 = maxu64(static_cast<uint64_t>(mDevice->BufferSize*srateScale + 0.5), + auto FrameCount64 = maxu64(static_cast<uint64_t>(std::ceil(mDevice->BufferSize*srateScale)), static_cast<UInt32>(outputFormat.mSampleRate)/10); FrameCount64 += MAX_RESAMPLER_PADDING; if(FrameCount64 > std::numeric_limits<int32_t>::max()) |