Skip to content

Commit

Permalink
Use base::SafeRound.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Sep 27, 2021
1 parent 29d5131 commit 8619486
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions webrtc/details/webrtc_openal_adm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,8 @@ crl::time AudioDeviceOpenAL::countExactQueuedMsForLatency(
= (double((queuedSamples - processedInOpenAL) >> (32 - 10))
/ double(kPlayoutFrequency * (1 << 10)));

const auto queuedTotal = crl::time(
std::round((secondsQueuedInDevice + secondsQueuedInOpenAL) * 1'000));
const auto queuedTotal = crl::time(base::SafeRound(
(secondsQueuedInDevice + secondsQueuedInOpenAL) * 1'000));

return countExact
? queuedTotal
Expand Down
2 changes: 1 addition & 1 deletion webrtc/win/webrtc_loopback_adm_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ void AudioDeviceLoopbackWin::processData() {
const auto deviceSamplesBefore = deviceSamplesCount - framesAvailable;
const auto fullDelay = counterDelta
+ (deviceSamplesBefore * _deviceFrequencyMultiplier);
return now - crl::time(std::round(fullDelay / 10'000.));
return now - crl::time(base::SafeRound(fullDelay / 10'000.));
};

while (samplesAvailable >= kWantedPartSize) {
Expand Down

0 comments on commit 8619486

Please sign in to comment.