From b9598227dcd25a706f21a7f7ece50dc257174278 Mon Sep 17 00:00:00 2001 From: Dan Minor Date: Fri, 15 May 2020 14:47:36 +0000 Subject: [PATCH] Bug 1632489 - Only adjust valid capture times when generating padding; r=bwc The current code will only set the TranmissionOffset extension if capture_time_ms is > 0, but when adjusting timestamps for rtx packets, it is adjusted without first checking to see if it is valid, which will cause invalid values of capture_time_ms to be written to TranmissionOffset, leading to assertion failures. This bug is still present on tip of libwebrtc, so we'll also need to prepare a patch for upstream. Depends on D74842 Differential Revision: https://phabricator.services.mozilla.com/D75528 --- .../webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_sender.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_sender.cc index 89b89251cd37..0a15c1c2e369 100644 --- a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_sender.cc +++ b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_sender.cc @@ -568,7 +568,9 @@ size_t RTPSender::SendPadData(size_t bytes, if (last_timestamp_time_ms_ > 0) { timestamp += (now_ms - last_timestamp_time_ms_) * kTimestampTicksPerMs; - capture_time_ms += (now_ms - last_timestamp_time_ms_); + if (capture_time_ms > 0) { + capture_time_ms += (now_ms - last_timestamp_time_ms_); + } } if (!ssrc_rtx_) { RTC_LOG(LS_ERROR) << "RTX SSRC unset.";