diff options
author | Chris Robinson <[email protected]> | 2023-12-26 00:02:23 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-12-26 02:21:35 -0800 |
commit | 1fddc044ac765d00e64628e59edcbcd71f0046b1 (patch) | |
tree | 9e6734e0527bd418a4775c7d41c3b6a25ca4eb41 /alc/backends/pulseaudio.cpp | |
parent | 095d1964feacaa4ec253db028fb1e8c04f718511 (diff) |
Clean up some gotos and non-optimal casts
Diffstat (limited to 'alc/backends/pulseaudio.cpp')
-rw-r--r-- | alc/backends/pulseaudio.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index dcf01095..77d45466 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -968,8 +968,9 @@ bool PulsePlayback::reset() const auto scale = static_cast<double>(mSpec.rate) / mDevice->Frequency; const auto perlen = static_cast<uint>(clampd(scale*mDevice->UpdateSize + 0.5, 64.0, 8192.0)); - const auto buflen = static_cast<uint>(clampd(scale*mDevice->BufferSize + 0.5, perlen*2, - std::numeric_limits<int>::max()/mFrameSize)); + const auto bufmax = uint{std::numeric_limits<int>::max() / mFrameSize}; + const auto buflen = static_cast<uint>(clampd(scale*mDevice->BufferSize + 0.5, perlen*2.0, + bufmax)); mAttr.maxlength = ~0u; mAttr.tlength = buflen * mFrameSize; |