diff --git a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/jitter_buffer.cc b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/jitter_buffer.cc index 651f960b167..a0567ca28dd 100644 --- a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/jitter_buffer.cc +++ b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/jitter_buffer.cc @@ -590,6 +590,11 @@ VCMEncodedFrame* VCMJitterBuffer::ExtractAndSetDecode(uint32_t timestamp) { if ((*frame).IsSessionComplete()) UpdateAveragePacketsPerFrame(frame->NumPackets()); + if (frame->Length() == 0) { + // Normally only if MakeDecodable() on an incomplete frame threw it all away + ReleaseFrame(frame); + return NULL; + } return frame; } diff --git a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/session_info.cc b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/session_info.cc index 8ec2349f56a..764a9f436d9 100644 --- a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/session_info.cc +++ b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/session_info.cc @@ -548,6 +548,9 @@ int VCMSessionInfo::InsertPacket(const VCMPacket& packet, int returnLength = InsertBuffer(frame_buffer, packet_list_it); UpdateCompleteSession(); + // We call MakeDecodable() before decoding, which removes packets after a loss + // (and which means h.264 mode 1 frames with a loss in the first packet will be + // totally removed) if (decode_error_mode == kWithErrors) decodable_ = true; else if (decode_error_mode == kSelectiveErrors)