-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect RTP timestamp in RTCP SR
Changes: * Add unit test CONVERT_TIMESTAMP_TO_RTP with math operations * Add parentheses in CONVERT_TIMESTAMP_TO_RTP parameters
- Loading branch information
1 parent
b5ee7ac
commit 8a64e7f
Showing
2 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,6 +160,15 @@ TEST_F(PeerConnectionApiTest, CONVERT_TIMESTAMP_TO_RTP_BigTimestamp) | |
EXPECT_EQ(144312782076270, rtpTimestamp); | ||
} | ||
|
||
TEST_F(PeerConnectionApiTest, CONVERT_TIMESTAMP_TO_RTP_MacroWithMathOperations) | ||
{ | ||
UINT64 rtpTimestamp = CONVERT_TIMESTAMP_TO_RTP(40000 + 50000, HUNDREDS_OF_NANOS_IN_A_SECOND); | ||
EXPECT_EQ(90000, rtpTimestamp); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
MushMal
Contributor
|
||
|
||
rtpTimestamp = CONVERT_TIMESTAMP_TO_RTP(90000, HUNDREDS_OF_NANOS_IN_A_SECOND + HUNDREDS_OF_NANOS_IN_A_SECOND); | ||
EXPECT_EQ(180000, rtpTimestamp); | ||
} | ||
|
||
} // namespace webrtcclient | ||
} // namespace video | ||
} // namespace kinesis | ||
|
Because of different floating point precision and formats, EXPECT_EQ can be flaky in different architectures, a better check would be something like approximately equal.