| Index: webrtc/modules/video_coding/frame_buffer2.cc
|
| diff --git a/webrtc/modules/video_coding/frame_buffer2.cc b/webrtc/modules/video_coding/frame_buffer2.cc
|
| index fcd523820f0ef7825b7edaacb63b7e33460e8d2c..c4e1aec834f719eed2bd2a9086f44ed891094319 100644
|
| --- a/webrtc/modules/video_coding/frame_buffer2.cc
|
| +++ b/webrtc/modules/video_coding/frame_buffer2.cc
|
| @@ -233,6 +233,17 @@ int FrameBuffer::InsertFrame(std::unique_ptr<FrameObject> frame) {
|
| }
|
| }
|
|
|
| + // Test if inserting this frame would cause the order of the frames to become
|
| + // ambiguous (covering more than half the interval of 2^16). This can happen
|
| + // when the picture id make large jumps mid stream.
|
| + if (!frames_.empty() &&
|
| + key < frames_.begin()->first &&
|
| + frames_.rbegin()->first < key) {
|
| + LOG(LS_WARNING) << "A jump in picture id was detected, clearing buffer.";
|
| + ClearFramesAndHistory();
|
| + last_continuous_picture_id = -1;
|
| + }
|
| +
|
| auto info = frames_.insert(std::make_pair(key, FrameInfo())).first;
|
|
|
| if (info->second.frame) {
|
|
|