Break backwards traversal loop if we have looped around all packets in the PacketBuffer for H264 frames.

BUG=webrtc:7532

Review-Url: https://codereview.webrtc.org/2868723003
Cr-Commit-Position: refs/heads/master@{#18191}
This commit is contained in:
philipel
2017-05-18 02:24:40 -07:00
committed by Commit bot
parent 7cc881d190
commit 539107175a
2 changed files with 30 additions and 10 deletions

View File

@ -477,5 +477,29 @@ TEST_F(TestPacketBuffer, ContinuousSeqNumDoubleMarkerBit) {
EXPECT_EQ(0UL, frames_from_callback_.size());
}
TEST_F(TestPacketBuffer, OneH264FrameFillBuffer) {
VCMPacket packet;
packet.seqNum = 0;
packet.codec = kVideoCodecH264;
packet.dataPtr = nullptr;
packet.sizeBytes = 0;
packet.is_first_packet_in_frame = true;
packet.markerBit = false;
packet_buffer_->InsertPacket(&packet);
packet.is_first_packet_in_frame = false;
for (int i = 1; i < kStartSize - 1; ++i) {
packet.seqNum = i;
packet_buffer_->InsertPacket(&packet);
}
packet.seqNum = kStartSize - 1;
packet.markerBit = true;
packet_buffer_->InsertPacket(&packet);
EXPECT_EQ(1UL, frames_from_callback_.size());
CheckFrame(0);
}
} // namespace video_coding
} // namespace webrtc