Bug 1632489 - Only adjust valid capture times when generating padding; r=bwc
authorDan Minor <dminor@mozilla.com>
Fri, 15 May 2020 14:47:36 +0000
changeset 530295 09a18345c269a8dddf7513e67f59fc20bc06f56f
parent 530294 aae972036546a0843c59e3655af1c60880bbaf73
child 530296 170cb6b6d8301e2a4834a54fa00a47c13e6e296a
push id37420
push usernerli@mozilla.com
push dateFri, 15 May 2020 21:52:36 +0000
treeherdermozilla-central@f340bbb582d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1632489
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
--- a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
+++ b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
@@ -563,17 +563,19 @@ size_t RTPSender::SendPadData(size_t byt
           break;
         }
         // Only change change the timestamp of padding packets sent over RTX.
         // Padding only packets over RTP has to be sent as part of a media
         // frame (and therefore the same timestamp).
         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.";
           return 0;
         }
         RTC_DCHECK(ssrc_rtx_);
         ssrc = *ssrc_rtx_;
         sequence_number = sequence_number_rtx_;