Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Unified Diff: webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc

Issue 2354843003: Add sanity check for decreasing RTP timestamp in RtpToNtpMs. (Closed)
Patch Set: remove {} Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/system_wrappers/source/rtp_to_ntp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc
diff --git a/webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc b/webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc
index 78e4a52716dbd0c37fe6c76dbd228e5427982636..0cfd6896f72f9f29402c79eace322aa895789270 100644
--- a/webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc
+++ b/webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc
@@ -136,6 +136,20 @@ TEST(WrapAroundTests, OldRtp_OldRtcpWrapped) {
EXPECT_FALSE(RtpToNtpMs(timestamp, rtcp, &timestamp_in_ms));
}
+TEST(RtpToNtpTests, FailsForDecreasingRtpTimestamp) {
+ const uint32_t kNtpSec1 = 3683354930;
+ const uint32_t kNtpFrac1 = 699925050;
+ const uint32_t kTimestamp1 = 2192705742;
+ const uint32_t kNtpSec2 = kNtpSec1;
+ const uint32_t kNtpFrac2 = kNtpFrac1 + kOneMsInNtpFrac;
+ const uint32_t kTimestamp2 = kTimestamp1 - kTimestampTicksPerMs;
+ RtcpList rtcp;
+ rtcp.push_front(RtcpMeasurement(kNtpSec1, kNtpFrac1, kTimestamp1));
+ rtcp.push_front(RtcpMeasurement(kNtpSec2, kNtpFrac2, kTimestamp2));
+ int64_t timestamp_in_ms = -1;
+ EXPECT_FALSE(RtpToNtpMs(kTimestamp1, rtcp, &timestamp_in_ms));
+}
+
TEST(UpdateRtcpListTests, InjectRtcpSrWithEqualNtp) {
RtcpList rtcp;
uint32_t ntp_sec = 0;
« no previous file with comments | « webrtc/system_wrappers/source/rtp_to_ntp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698