Don't attempt to unwrap RTP timestamps for RTX stream.
This fixes a bug where the event_log_visualizer hits a DCHECK when the RTP timestamp jumps.
TBR = kwiberg
Bug: webrtc:10170
Change-Id: I127a8e6165265d0726892a912f5bcdc33d98ced5
Reviewed-on: https://webrtc-review.googlesource.com/c/119664
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26410}
diff --git a/logging/rtc_event_log/rtc_event_log_parser.cc b/logging/rtc_event_log/rtc_event_log_parser.cc
index 32dd92d..2c49b8d 100644
--- a/logging/rtc_event_log/rtc_event_log_parser.cc
+++ b/logging/rtc_event_log/rtc_event_log_parser.cc
@@ -1891,12 +1891,18 @@
auto rtp_handler = [&](const LoggedRtpPacket& rtp) {
advance_time(Timestamp::ms(rtp.log_time_ms()));
MediaStreamInfo* stream = &streams[rtp.header.ssrc];
- uint64_t capture_ticks =
- stream->unwrap_capture_ticks.Unwrap(rtp.header.timestamp);
- // TODO(srte): Use logged sample rate when it is added to the format.
- Timestamp capture_time = Timestamp::seconds(
- capture_ticks /
- (stream->media_type == LoggedMediaType::kAudio ? 48000.0 : 90000.0));
+ Timestamp capture_time = Timestamp::MinusInfinity();
+ if (!stream->rtx) {
+ // RTX copy the timestamp of the retransmitted packets. This means that
+ // RTX streams don't have a unique clock offset and frequency, so
+ // the RTP timstamps can't be unwrapped.
+ uint64_t capture_ticks =
+ stream->unwrap_capture_ticks.Unwrap(rtp.header.timestamp);
+ // TODO(srte): Use logged sample rate when it is added to the format.
+ capture_time = Timestamp::seconds(
+ capture_ticks /
+ (stream->media_type == LoggedMediaType::kAudio ? 48000.0 : 90000.0));
+ }
LoggedPacketInfo logged(rtp, stream->media_type, stream->rtx, capture_time);
logged.overhead = current_overhead;
if (rtp.header.extension.hasTransportSequenceNumber) {
diff --git a/rtc_base/units/unit_base.h b/rtc_base/units/unit_base.h
index 5503a32..37b60a0 100644
--- a/rtc_base/units/unit_base.h
+++ b/rtc_base/units/unit_base.h
@@ -23,7 +23,7 @@
namespace rtc_units_impl {
// UnitBase is a base class for implementing custom value types with a specific
-// unit. It provides type safety and sommonly useful operations. The undelying
+// unit. It provides type safety and commonly useful operations. The underlying
// storage is always an int64_t, it's up to the unit implementation to choose
// what scale it represents.
//