Add one unit test for NACKing a key frame

Adding a test case that wasn't covered. This new test is passing.

R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1475004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4051 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
hclam@chromium.org
2013-05-16 21:19:59 +00:00
parent b3e5acfb66
commit fe307e1332
2 changed files with 33 additions and 0 deletions

View File

@ -844,6 +844,9 @@ uint16_t VCMJitterBuffer::EstimatedLowSequenceNumber(
assert(frame.GetLowSeqNum() >= 0);
if (frame.HaveFirstPacket())
return frame.GetLowSeqNum();
// This estimate is not accurate if more than one packet with lower sequence
// number is lost.
return frame.GetLowSeqNum() - 1;
}
@ -895,6 +898,8 @@ uint16_t* VCMJitterBuffer::GetNackList(uint16_t* nack_list_size,
} else {
// Skip to the last key frame. If it's incomplete we will start
// NACKing it.
// Note that the estimated low sequence number is correct for VP8
// streams because only the first packet of a key frame is marked.
last_decoded_state_.Reset();
DropPacketsFromNackList(EstimatedLowSequenceNumber(**rit));
}
@ -1129,6 +1134,8 @@ bool VCMJitterBuffer::RecycleFramesUntilKeyFrame() {
if (it != frame_list_.end() && (*it)->FrameType() == kVideoFrameKey) {
// Reset last decoded state to make sure the next frame decoded is a key
// frame, and start NACKing from here.
// Note that the estimated low sequence number is correct for VP8
// streams because only the first packet of a key frame is marked.
last_decoded_state_.Reset();
DropPacketsFromNackList(EstimatedLowSequenceNumber(**it));
return true;