Reject re-inserting already decoded frames into FrameBuffer2.
BUG=webrtc:7518 Review-Url: https://codereview.webrtc.org/2842133002 Cr-Commit-Position: refs/heads/master@{#17925}
This commit is contained in:
parent
56c78aea5f
commit
f684269541
@ -237,7 +237,7 @@ int FrameBuffer::InsertFrame(std::unique_ptr<FrameObject> frame) {
|
||||
}
|
||||
|
||||
if (last_decoded_frame_it_ != frames_.end() &&
|
||||
key < last_decoded_frame_it_->first) {
|
||||
key <= last_decoded_frame_it_->first) {
|
||||
if (AheadOf(frame->timestamp, last_decoded_frame_timestamp_) &&
|
||||
frame->num_references == 0) {
|
||||
// If this frame has a newer timestamp but an earlier picture id then we
|
||||
|
||||
@ -516,5 +516,11 @@ TEST_F(TestFrameBuffer2, ForwardJumps) {
|
||||
ExtractFrame();
|
||||
}
|
||||
|
||||
TEST_F(TestFrameBuffer2, DuplicateFrames) {
|
||||
EXPECT_EQ(22256, InsertFrame(22256, 0, 1, false));
|
||||
ExtractFrame();
|
||||
EXPECT_EQ(22256, InsertFrame(22256, 0, 1, false));
|
||||
}
|
||||
|
||||
} // namespace video_coding
|
||||
} // namespace webrtc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user