Don't detect a new frame if a previous packet is used in a previous frame.
In this CL: - Removed unused variable |last_seq_num_|. - Fixed bug where a new incomplete frame was detected as a complete frame. - Added fuzzer to video_coding::PacketBuffer. BUG=chromium:677101 Review-Url: https://codereview.webrtc.org/2613833003 Cr-Commit-Position: refs/heads/master@{#16003}
This commit is contained in:
@ -40,7 +40,6 @@ PacketBuffer::PacketBuffer(Clock* clock,
|
||||
size_(start_buffer_size),
|
||||
max_size_(max_buffer_size),
|
||||
first_seq_num_(0),
|
||||
last_seq_num_(0),
|
||||
first_packet_received_(false),
|
||||
is_cleared_to_first_seq_num_(false),
|
||||
data_buffer_(start_buffer_size),
|
||||
@ -65,7 +64,6 @@ bool PacketBuffer::InsertPacket(VCMPacket* packet) {
|
||||
|
||||
if (!first_packet_received_) {
|
||||
first_seq_num_ = seq_num;
|
||||
last_seq_num_ = seq_num;
|
||||
first_packet_received_ = true;
|
||||
} else if (AheadOf(first_seq_num_, seq_num)) {
|
||||
// If we have explicitly cleared past this packet then it's old,
|
||||
@ -100,9 +98,6 @@ bool PacketBuffer::InsertPacket(VCMPacket* packet) {
|
||||
}
|
||||
}
|
||||
|
||||
if (AheadOf(seq_num, last_seq_num_))
|
||||
last_seq_num_ = seq_num;
|
||||
|
||||
sequence_buffer_[index].frame_begin = packet->is_first_packet_in_frame;
|
||||
sequence_buffer_[index].frame_end = packet->markerBit;
|
||||
sequence_buffer_[index].seq_num = packet->seqNum;
|
||||
@ -186,6 +181,8 @@ bool PacketBuffer::PotentialNewFrame(uint16_t seq_num) const {
|
||||
return true;
|
||||
if (!sequence_buffer_[prev_index].used)
|
||||
return false;
|
||||
if (sequence_buffer_[prev_index].frame_created)
|
||||
return false;
|
||||
if (sequence_buffer_[prev_index].seq_num !=
|
||||
static_cast<uint16_t>(sequence_buffer_[index].seq_num - 1)) {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user