diff options
author | Chris Robinson <[email protected]> | 2022-05-11 17:38:16 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-05-13 15:40:15 -0700 |
commit | d38d9b091eaae5e3d36fde64c597d2ec68370339 (patch) | |
tree | c9d371d65a8c347d77d9b73b6936678fbe95a13d /alc/backends | |
parent | 0bf2abae9b2121c3bc5a56dab30eca308136bc29 (diff) |
Remove a couple unnecessary casts
Diffstat (limited to 'alc/backends')
-rw-r--r-- | alc/backends/coreaudio.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index adaa52bd..f779f844 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -425,8 +425,8 @@ bool CoreAudioPlayback::reset() */ if(mDevice->Frequency != streamFormat.mSampleRate) { - mDevice->BufferSize = static_cast<uint>(uint64_t{mDevice->BufferSize} * - streamFormat.mSampleRate / mDevice->Frequency); + mDevice->BufferSize = static_cast<uint>(mDevice->BufferSize*streamFormat.mSampleRate/ + mDevice->Frequency + 0.5); mDevice->Frequency = static_cast<uint>(streamFormat.mSampleRate); } @@ -799,7 +799,7 @@ void CoreAudioCapture::open(const char *name) /* Calculate the minimum AudioUnit output format frame count for the pre- * conversion ring buffer. Ensure at least 100ms for the total buffer. */ - double srateScale{double{outputFormat.mSampleRate} / mDevice->Frequency}; + double srateScale{outputFormat.mSampleRate / mDevice->Frequency}; auto FrameCount64 = maxu64(static_cast<uint64_t>(std::ceil(mDevice->BufferSize*srateScale)), static_cast<UInt32>(outputFormat.mSampleRate)/10); FrameCount64 += MaxResamplerPadding; |