Don't try to resend packets that were removed out of order.
Bug: webrtc:11206 Change-Id: Iae05e1db80afd871d37aca203e17bad40dbc9522 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162041 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30083}
This commit is contained in:
parent
d77c829d37
commit
5e9cac984f
@ -456,7 +456,8 @@ int RtpPacketHistory::GetPacketIndex(uint16_t sequence_number) const {
|
||||
RtpPacketHistory::StoredPacket* RtpPacketHistory::GetStoredPacket(
|
||||
uint16_t sequence_number) {
|
||||
int index = GetPacketIndex(sequence_number);
|
||||
if (index < 0 || static_cast<size_t>(index) >= packet_history_.size()) {
|
||||
if (index < 0 || static_cast<size_t>(index) >= packet_history_.size() ||
|
||||
packet_history_[index].packet_ == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
return &packet_history_[index];
|
||||
|
||||
@ -735,6 +735,20 @@ TEST_F(RtpPacketHistoryTest, PayloadPaddingWithEncapsulation) {
|
||||
EXPECT_EQ(padding_packet->SequenceNumber(), kStartSeqNum + 1);
|
||||
}
|
||||
|
||||
TEST_F(RtpPacketHistoryTest, NackAfterAckIsNoop) {
|
||||
hist_.SetStorePacketsStatus(StorageMode::kStoreAndCull, 2);
|
||||
// Add two sent packets.
|
||||
hist_.PutRtpPacket(CreateRtpPacket(kStartSeqNum),
|
||||
fake_clock_.TimeInMilliseconds());
|
||||
hist_.PutRtpPacket(CreateRtpPacket(kStartSeqNum + 1),
|
||||
fake_clock_.TimeInMilliseconds());
|
||||
// Remove newest one.
|
||||
hist_.CullAcknowledgedPackets(std::vector<uint16_t>{kStartSeqNum + 1});
|
||||
// Retransmission request for already acked packet, should be noop.
|
||||
auto packet = hist_.GetPacketAndMarkAsPending(kStartSeqNum + 1);
|
||||
EXPECT_EQ(packet.get(), nullptr);
|
||||
}
|
||||
|
||||
TEST_F(RtpPacketHistoryTest, OutOfOrderInsertRemoval) {
|
||||
hist_.SetStorePacketsStatus(StorageMode::kStoreAndCull, 10);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user