Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 894c0c6

Browse files
Cast sequence number in RtpFrameObject.
BUG=webrtc:7700 Review-Url: https://codereview.webrtc.org/2902743002 Cr-Original-Commit-Position: refs/heads/master@{#18237} Review-Url: https://codereview.webrtc.org/2914683002 . Cr-Commit-Position: refs/branch-heads/59@{#15} Cr-Branched-From: 10d095d-refs/heads/master@{#17657}
1 parent b9ca680 commit 894c0c6

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

webrtc/modules/video_coding/frame_object.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer,
3535
received_time_(received_time),
3636
times_nacked_(times_nacked) {
3737
VCMPacket* first_packet = packet_buffer_->GetPacket(first_seq_num);
38-
RTC_DCHECK(first_packet);
38+
RTC_CHECK(first_packet);
3939

4040
// RtpFrameObject members
4141
frame_type_ = first_packet->frameType;
@@ -74,10 +74,11 @@ RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer,
7474
_frameType = kVideoFrameDelta;
7575
frame_type_ = kVideoFrameDelta;
7676
for (uint16_t seq_num = first_seq_num;
77-
seq_num != last_seq_num + 1 && _frameType == kVideoFrameDelta;
77+
seq_num != static_cast<uint16_t>(last_seq_num + 1) &&
78+
_frameType == kVideoFrameDelta;
7879
++seq_num) {
7980
VCMPacket* packet = packet_buffer_->GetPacket(seq_num);
80-
RTC_DCHECK(packet);
81+
RTC_CHECK(packet);
8182
const RTPVideoHeaderH264& header = packet->video_header.codecHeader.H264;
8283
for (size_t i = 0; i < header.nalus_length; ++i) {
8384
if (header.nalus[i].type == H264::NaluType::kIdr) {
@@ -100,7 +101,7 @@ RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer,
100101
timestamp = first_packet->timestamp;
101102

102103
VCMPacket* last_packet = packet_buffer_->GetPacket(last_seq_num);
103-
RTC_DCHECK(last_packet && last_packet->markerBit);
104+
RTC_CHECK(last_packet && last_packet->markerBit);
104105
// http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/
105106
// ts_126114v120700p.pdf Section 7.4.5.
106107
// The MTSI client shall add the payload bytes as defined in this clause

webrtc/modules/video_coding/video_packet_buffer_unittest.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,5 +501,24 @@ TEST_F(TestPacketBuffer, OneH264FrameFillBuffer) {
501501
CheckFrame(0);
502502
}
503503

504+
TEST_F(TestPacketBuffer, OneH264FrameMaxSeqNum) {
505+
VCMPacket packet;
506+
packet.seqNum = 65534;
507+
packet.codec = kVideoCodecH264;
508+
packet.dataPtr = nullptr;
509+
packet.sizeBytes = 0;
510+
packet.is_first_packet_in_frame = true;
511+
packet.markerBit = false;
512+
packet_buffer_->InsertPacket(&packet);
513+
514+
packet.is_first_packet_in_frame = false;
515+
packet.seqNum = 65535;
516+
packet.markerBit = true;
517+
packet_buffer_->InsertPacket(&packet);
518+
519+
EXPECT_EQ(1UL, frames_from_callback_.size());
520+
CheckFrame(65534);
521+
}
522+
504523
} // namespace video_coding
505524
} // namespace webrtc

0 commit comments

Comments
 (0)