From 433b95a68585313fb5d607639e6a6f6d3de70427 Mon Sep 17 00:00:00 2001 From: Taylor Brandstetter Date: Fri, 18 Mar 2016 11:41:03 -0700 Subject: [PATCH] Fixing issues with timestamps in video_quality_test.cc. The fundamental issue is that RTCP packet timestamps were accidentally being fed into wrap_handler_, causing it to think the 32-bit timestamp had wrapped around when it actually hadn't. Was also using a 32-bit timestamp instead of a 64-bit timestamp in one place, meaning that if wrapping actually DID occur, the test would still fail due to a 64-bit value being cast to a 32-bit value. BUG=webrtc:5668 R=pbos@webrtc.org, sprang@webrtc.org Review URL: https://codereview.webrtc.org/1814023003 . Cr-Commit-Position: refs/heads/master@{#12055} --- webrtc/video/video_quality_test.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc index fb07e88a72..8dfbc79749 100644 --- a/webrtc/video/video_quality_test.cc +++ b/webrtc/video/video_quality_test.cc @@ -118,6 +118,12 @@ class VideoAnalyzer : public PacketReceiver, const uint8_t* packet, size_t length, const PacketTime& packet_time) override { + // Ignore timestamps of RTCP packets. They're not synchronized with + // RTP packet timestamps and so they would confuse wrap_handler_. + if (RtpHeaderParser::IsRtcp(packet, length)) { + return receiver_->DeliverPacket(media_type, packet, length, packet_time); + } + RtpUtility::RtpHeaderParser parser(packet, length); RTPHeader header; parser.Parse(&header); @@ -205,7 +211,7 @@ class VideoAnalyzer : public PacketReceiver, Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); rtc::CritScope lock(&crit_); - uint32_t send_timestamp = + int64_t send_timestamp = wrap_handler_.Unwrap(video_frame.timestamp() - rtp_timestamp_delta_); while (wrap_handler_.Unwrap(frames_.front().timestamp()) < send_timestamp) {