From 00a1bcb441d61b81e605121dfb1a7342f83ac638 Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Tue, 17 Dec 2019 10:21:05 +0100 Subject: [PATCH] Ensure that unset capture timestamp wouldn't cause incorrect SR rtp timestamps If for some reason capture timestamp is unset, the default value of 0 would be passed to RtcpSender. This will cause rtp timestamps to grow at double the rate in Sender Reports because it has time since the last frame capture as a term. Bug: none Change-Id: I2fe09dabef6b0957fb504deaa06393dedc4a9e70 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162481 Reviewed-by: Danil Chapovalov Commit-Queue: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/master@{#30105} --- modules/rtp_rtcp/source/rtcp_sender.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rtp_rtcp/source/rtcp_sender.cc b/modules/rtp_rtcp/source/rtcp_sender.cc index 0f119ef235..f06d429fb9 100644 --- a/modules/rtp_rtcp/source/rtcp_sender.cc +++ b/modules/rtp_rtcp/source/rtcp_sender.cc @@ -318,7 +318,7 @@ void RTCPSender::SetLastRtpTime(uint32_t rtp_timestamp, last_payload_type_ = payload_type; } last_rtp_timestamp_ = rtp_timestamp; - if (capture_time_ms < 0) { + if (capture_time_ms <= 0) { // We don't currently get a capture time from VoiceEngine. last_frame_capture_time_ms_ = clock_->TimeInMilliseconds(); } else {