Chromium Code Reviews| 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 452e762b9f10c5c41392e81bf95531124da95e8e..ca1b090d26901bd81d2b1c4d52cf6fe52661a7ec 100644 |
| --- a/webrtc/modules/video_coding/packet_buffer.cc |
| +++ b/webrtc/modules/video_coding/packet_buffer.cc |
| @@ -211,17 +211,27 @@ std::vector<std::unique_ptr<RtpFrameObject>> PacketBuffer::FindFrames( |
| // Find the start index by searching backward until the packet with |
| // the |frame_begin| flag is set. |
| int start_index = index; |
| + |
| + bool is_h264 = data_buffer_[start_index].codec == kVideoCodecH264; |
| + int64_t frame_timestamp = data_buffer_[start_index].timestamp; |
| while (true) { |
| frame_size += data_buffer_[start_index].sizeBytes; |
| max_nack_count = |
| std::max(max_nack_count, data_buffer_[start_index].timesNacked); |
| sequence_buffer_[start_index].frame_created = true; |
| - if (sequence_buffer_[start_index].frame_begin) |
| + if (!is_h264 && sequence_buffer_[start_index].frame_begin) |
| break; |
| start_index = start_index > 0 ? start_index - 1 : size_ - 1; |
| - start_seq_num--; |
| + |
| + if (is_h264 && start_index != static_cast<int>(index) && |
|
stefan-webrtc
2017/02/02 15:19:00
Can we have a short comment on what this is trying
philipel
2017/02/02 15:47:37
Added a comment about it.
|
| + (!sequence_buffer_[start_index].used || |
| + data_buffer_[start_index].timestamp != frame_timestamp)) { |
| + break; |
| + } |
| + |
| + --start_seq_num; |
| } |
| found_frames.emplace_back( |