diff options
author | Chris Robinson <[email protected]> | 2023-12-17 22:36:44 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-12-17 22:36:44 -0800 |
commit | 708a90ef8ef7ee00991556298073c50dfa6e72a1 (patch) | |
tree | 5d72e46977dc241febfcf6ad4ab2ffbe2fadf2c3 /alc/alc.cpp | |
parent | bc83c874ff15b29fdab9b6c0bf40b268345b3026 (diff) |
Fix some implicit conversions
Diffstat (limited to 'alc/alc.cpp')
-rw-r--r-- | alc/alc.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index 03d36de7..a0fbdb0f 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1532,7 +1532,7 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) case DevFmtAmbi3D: break; } - nanoseconds::rep sample_delay{0}; + size_t sample_delay{0}; if(auto *encoder{device->mUhjEncoder.get()}) sample_delay += encoder->getDelay(); @@ -1625,6 +1625,7 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) } /* Convert the sample delay from samples to nanosamples to nanoseconds. */ + sample_delay = std::min<size_t>(sample_delay, std::numeric_limits<int>::max()); device->FixedLatency += nanoseconds{seconds{sample_delay}} / device->Frequency; TRACE("Fixed device latency: %" PRId64 "ns\n", int64_t{device->FixedLatency.count()}); |