Skip non-continuous FrameInfos when finding the next frame to return from FrameBuffer::NextFrame.

Also added DCHECKS to make sure that FrameInfos are not incorrectly updated.

BUG=webrtc:5514
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/2394823002 .

Cr-Commit-Position: refs/heads/master@{#14549}
This commit is contained in:
philipel
2016-10-06 12:25:13 +02:00
parent 55b9544290
commit 93e451b0f5
2 changed files with 36 additions and 3 deletions

View File

@ -263,6 +263,22 @@ TEST_F(TestFrameBuffer2, ExtractFromEmptyBuffer) {
CheckNoFrame(0);
}
TEST_F(TestFrameBuffer2, MissingFrame) {
uint16_t pid = Rand();
uint32_t ts = Rand();
InsertFrame(pid, 0, ts, false);
InsertFrame(pid + 2, 0, ts, false, pid);
InsertFrame(pid + 3, 0, ts, false, pid + 1, pid + 2);
ExtractFrame();
ExtractFrame();
ExtractFrame();
CheckFrame(0, pid, 0);
CheckFrame(1, pid + 2, 0);
CheckNoFrame(2);
}
TEST_F(TestFrameBuffer2, OneLayerStream) {
uint16_t pid = Rand();
uint32_t ts = Rand();