Remove failing RTC_DCHECK in nack_module.cc.

The RTC_DCHECK is hit sometimes. This happens when there is no overlap
between the nack_list and frames in keyframes. The existing code
correctly handles this situation.

Bug: webrtc:9629
Change-Id: I7e3eed1b04781cd69974c5d3eb86e382e9587268
Reviewed-on: https://webrtc-review.googlesource.com/102340
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24860}
This commit is contained in:
Johannes Kron
2018-09-27 11:49:22 +02:00
committed by Commit Bot
parent e9a7e90625
commit 6fbeeeb872
2 changed files with 15 additions and 1 deletions

View File

@ -164,7 +164,6 @@ bool NackModule::RemovePacketsUntilKeyFrame() {
if (it != nack_list_.begin()) {
// We have found a keyframe that actually is newer than at least one
// packet in the nack list.
RTC_DCHECK(it != nack_list_.end());
nack_list_.erase(nack_list_.begin(), it);
return true;
}

View File

@ -262,4 +262,19 @@ TEST_F(TestNackModule, PacketNackCount) {
EXPECT_EQ(0, nack_module_.OnReceivedPacket(4, false));
}
TEST_F(TestNackModule, NackListFullAndNoOverlapWithKeyframes) {
const int kMaxNackPackets = 1000;
const unsigned int kFirstGap = kMaxNackPackets - 20;
const unsigned int kSecondGap = 200;
uint16_t seq_num = 0;
nack_module_.OnReceivedPacket(seq_num++, true);
seq_num += kFirstGap;
nack_module_.OnReceivedPacket(seq_num++, true);
EXPECT_EQ(kFirstGap, sent_nacks_.size());
sent_nacks_.clear();
seq_num += kSecondGap;
nack_module_.OnReceivedPacket(seq_num, true);
EXPECT_EQ(kSecondGap, sent_nacks_.size());
}
} // namespace webrtc