Fixes two bugs related to padding in the jitter buffer.

- Pad packets (empty) were often NACKed even though they were received.
- Padding only frames (empty) were didn't properly update the decoding state,
  and would therefore be NACKed even though they were received.

TEST=trybots

BUG=1150

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3183 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org
2012-11-28 19:36:20 +00:00
parent 891d55eb35
commit e4fb44c29d
8 changed files with 217 additions and 38 deletions

View File

@ -933,8 +933,7 @@ uint16_t* VCMJitterBuffer::CreateNackList(uint16_t* nack_list_size,
// We don't need to check if frame is decoding since low_seq_num is based
// on the last decoded sequence number.
VCMFrameBufferStateEnum state = frame_buffers_[i]->GetState();
if ((kStateFree != state) &&
(kStateEmpty != state)) {
if (kStateFree != state) {
// Reaching thus far means we are going to update the NACK list
// When in hybrid mode, we use the soft NACKing feature.
if (nack_mode_ == kNackHybrid) {
@ -1271,11 +1270,11 @@ FrameList::iterator VCMJitterBuffer::FindOldestCompleteContinuousFrame(
void VCMJitterBuffer::CleanUpOldFrames() {
while (frame_list_.size() > 0) {
VCMFrameBuffer* oldest_frame = frame_list_.front();
bool next_frame_empty =
(last_decoded_state_.ContinuousFrame(oldest_frame) &&
oldest_frame->GetState() == kStateEmpty);
if (last_decoded_state_.IsOldFrame(oldest_frame) ||
(next_frame_empty && frame_list_.size() > 1)) {
if (oldest_frame->GetState() == kStateEmpty && frame_list_.size() > 1) {
// This frame is empty, mark it as decoded, thereby making it old.
last_decoded_state_.UpdateEmptyFrame(oldest_frame);
}
if (last_decoded_state_.IsOldFrame(oldest_frame)) {
ReleaseFrameIfNotDecoding(frame_list_.front());
frame_list_.erase(frame_list_.begin());
} else {