Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Unified Diff: webrtc/modules/video_coding/packet_buffer.cc

Issue 2527903002: Fixed bug in PacketBuffer to correctly detect new complete frames. (Closed)
Patch Set: Feedback fix Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/video_coding/video_packet_buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/packet_buffer.cc
diff --git a/webrtc/modules/video_coding/packet_buffer.cc b/webrtc/modules/video_coding/packet_buffer.cc
index 1b6fecc3856883bb24c8bf14f21e29241e86cf27..c9d787b6e66184b0f1c0690227d5743397d5c54b 100644
--- a/webrtc/modules/video_coding/packet_buffer.cc
+++ b/webrtc/modules/video_coding/packet_buffer.cc
@@ -172,16 +172,8 @@ bool PacketBuffer::PotentialNewFrame(uint16_t seq_num) const {
return false;
if (sequence_buffer_[index].frame_created)
return false;
- if (sequence_buffer_[index].frame_begin &&
- (!sequence_buffer_[prev_index].used ||
- AheadOf(seq_num, sequence_buffer_[prev_index].seq_num))) {
- // The reason we only return true if this packet is the first packet of the
- // frame and the sequence number is newer than the packet with the previous
- // index is because we want to avoid an inifite loop in the case where
- // a single frame containing more packets than the current size of the
- // packet buffer is inserted.
+ if (sequence_buffer_[index].frame_begin)
return true;
- }
if (!sequence_buffer_[prev_index].used)
return false;
if (sequence_buffer_[prev_index].seq_num !=
@@ -197,7 +189,8 @@ bool PacketBuffer::PotentialNewFrame(uint16_t seq_num) const {
std::vector<std::unique_ptr<RtpFrameObject>> PacketBuffer::FindFrames(
uint16_t seq_num) {
std::vector<std::unique_ptr<RtpFrameObject>> found_frames;
- while (PotentialNewFrame(seq_num)) {
+ size_t packets_tested = 0;
+ while (packets_tested < size_ && PotentialNewFrame(seq_num)) {
size_t index = seq_num % size_;
sequence_buffer_[index].continuous = true;
@@ -229,6 +222,7 @@ std::vector<std::unique_ptr<RtpFrameObject>> PacketBuffer::FindFrames(
max_nack_count, clock_->TimeInMilliseconds()));
}
++seq_num;
+ ++packets_tested;
}
return found_frames;
}
« no previous file with comments | « no previous file | webrtc/modules/video_coding/video_packet_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698