summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0079.patch
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0079.patch')
-rw-r--r--third_party/libwebrtc/moz-patch-stack/0079.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0079.patch b/third_party/libwebrtc/moz-patch-stack/0079.patch
new file mode 100644
index 0000000000..39abbd9995
--- /dev/null
+++ b/third_party/libwebrtc/moz-patch-stack/0079.patch
@@ -0,0 +1,45 @@
+From: Andreas Pehrson <apehrson@mozilla.com>
+Date: Wed, 11 Jan 2023 22:42:00 +0000
+Subject: Bug 1800942 - Add DCHECKs to
+ TimestampExtrapolator::ExtrapolateLocalTime. r=mjf
+
+Differential Revision: https://phabricator.services.mozilla.com/D166536
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/c5df7f40392464ffc63f44a53ddcaab2091741e0
+---
+ modules/video_coding/timing/timestamp_extrapolator.cc | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/modules/video_coding/timing/timestamp_extrapolator.cc b/modules/video_coding/timing/timestamp_extrapolator.cc
+index c91aa1a362..dc62ac674a 100644
+--- a/modules/video_coding/timing/timestamp_extrapolator.cc
++++ b/modules/video_coding/timing/timestamp_extrapolator.cc
+@@ -125,6 +125,7 @@ void TimestampExtrapolator::Update(Timestamp now, uint32_t ts90khz) {
+ absl::optional<Timestamp> TimestampExtrapolator::ExtrapolateLocalTime(
+ uint32_t timestamp90khz) const {
+ int64_t unwrapped_ts90khz = unwrapper_.PeekUnwrap(timestamp90khz);
++ RTC_DCHECK_GE(unwrapped_ts90khz, 0);
+
+ if (!first_unwrapped_timestamp_) {
+ return absl::nullopt;
+@@ -132,12 +133,18 @@ absl::optional<Timestamp> TimestampExtrapolator::ExtrapolateLocalTime(
+ constexpr double kRtpTicksPerMs = 90;
+ TimeDelta diff = TimeDelta::Millis(
+ (unwrapped_ts90khz - *prev_unwrapped_timestamp_) / kRtpTicksPerMs);
++ if (diff.ms() < 0) {
++ RTC_DCHECK_GE(prev_.ms(), -diff.ms());
++ }
+ return prev_ + diff;
+ } else if (w_[0] < 1e-3) {
+ return start_;
+ } else {
+ double timestampDiff = unwrapped_ts90khz - *first_unwrapped_timestamp_;
+ auto diff_ms = static_cast<int64_t>((timestampDiff - w_[1]) / w_[0] + 0.5);
++ if (diff_ms < 0) {
++ RTC_DCHECK_GE(start_.ms(), -diff_ms);
++ }
+ return start_ + TimeDelta::Millis(diff_ms);
+ }
+ }
+--
+2.34.1
+