Avoid creating frames with packets of different timestamps.
Bug: None Change-Id: Ieca71f844d546c2e97b95131153913f138842acd Reviewed-on: https://webrtc-review.googlesource.com/c/116680 Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26176}
This commit is contained in:
@ -266,6 +266,8 @@ bool PacketBuffer::PotentialNewFrame(uint16_t seq_num) const {
|
||||
static_cast<uint16_t>(sequence_buffer_[index].seq_num - 1)) {
|
||||
return false;
|
||||
}
|
||||
if (data_buffer_[prev_index].timestamp != data_buffer_[index].timestamp)
|
||||
return false;
|
||||
if (sequence_buffer_[prev_index].continuous)
|
||||
return true;
|
||||
|
||||
|
@ -706,6 +706,13 @@ TEST_F(TestPacketBuffer, FramesAfterClear) {
|
||||
CheckFrame(9057);
|
||||
}
|
||||
|
||||
TEST_F(TestPacketBuffer, SameFrameDifferentTimestamps) {
|
||||
Insert(0, kKeyFrame, kFirst, kNotLast, 0, nullptr, 1000);
|
||||
Insert(1, kKeyFrame, kNotFirst, kLast, 0, nullptr, 1001);
|
||||
|
||||
ASSERT_EQ(0UL, frames_from_callback_.size());
|
||||
}
|
||||
|
||||
TEST_F(TestPacketBuffer, DontLeakPayloadData) {
|
||||
// NOTE! Any eventual leak is suppose to be detected by valgrind
|
||||
// or any other similar tool.
|
||||
|
Reference in New Issue
Block a user