Check if packet in PacketBuffer was cleared before the frame was fully received.

Bug: none
Change-Id: Iaa5702a8da93462ba80f72821f075a6673eeb0e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260324
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36694}
This commit is contained in:
philipel
2022-04-28 14:31:55 +02:00
committed by WebRTC LUCI CQ
parent 9432768024
commit 90623e1a91
2 changed files with 32 additions and 17 deletions

View File

@ -291,6 +291,13 @@ TEST_F(PacketBufferTest, ClearSinglePacket) {
Insert(seq_num + kMaxSize, kDeltaFrame, kFirst, kLast).buffer_cleared);
}
TEST_F(PacketBufferTest, ClearPacketBeforeFullyReceivedFrame) {
Insert(0, kKeyFrame, kFirst, kNotLast);
Insert(1, kKeyFrame, kNotFirst, kNotLast);
packet_buffer_.ClearTo(0);
EXPECT_THAT(Insert(2, kKeyFrame, kNotFirst, kLast).packets, IsEmpty());
}
TEST_F(PacketBufferTest, ClearFullBuffer) {
for (int i = 0; i < kMaxSize; ++i)
Insert(i, kDeltaFrame, kFirst, kLast);