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 <danilchap@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30105}
This commit is contained in:
Ilya Nikolaevskiy
2019-12-17 10:21:05 +01:00
committed by Commit Bot
parent f4cf4c789a
commit 00a1bcb441

View File

@ -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 {