Revert "Fix overflow due to rounding in AbsoluteSendTime::To24Bits"
This reverts commit a17651f7d8748905d902eedf34471a0c227ca789. Reason for revert: triggers failure in downstream test Original change's description: > Fix overflow due to rounding in AbsoluteSendTime::To24Bits > > Actual rounding is not important for this time as long it is consistent > during the call: only difference between two absolute send time matter > Rounding down avoids producing 1 < 24 when value is close to the wrap around boundary. > > Bug: None > Change-Id: Ibbf5bae21bc37eccdc5d4c130a59796ee5108017 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268001 > Commit-Queue: Åsa Persson <asapersson@webrtc.org> > Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> > Reviewed-by: Åsa Persson <asapersson@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#37468} Bug: None Change-Id: I90a9c1b174b918b7ede58c3bbdb879b1b67da7b2 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268120 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37473}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
3f207658da
commit
791294a647
@ -26,6 +26,7 @@
|
||||
#include "api/video/video_rotation.h"
|
||||
#include "api/video/video_timing.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "rtc_base/numerics/divide_round.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -44,7 +45,7 @@ class AbsoluteSendTime {
|
||||
|
||||
static constexpr uint32_t To24Bits(Timestamp time) {
|
||||
int64_t time_us = time.us() % (int64_t{1 << 6} * 1'000'000);
|
||||
int64_t time6x18 = (time_us << 18) / 1'000'000;
|
||||
int64_t time6x18 = DivideRoundToNearest(time_us << 18, 1'000'000);
|
||||
RTC_DCHECK_GE(time6x18, 0);
|
||||
RTC_DCHECK_LT(time6x18, 1 << 24);
|
||||
return static_cast<uint32_t>(time6x18);
|
||||
|
||||
Reference in New Issue
Block a user