Bug 1162251: Fix WebRTC jitter buffer ignoring partial frames if the packet holds a complete NAL r=ehugg a=sylvestre
authorRandell Jesup <rjesup@jesup.org>
Thu, 07 May 2015 20:05:20 -0400
changeset 260430 124857c54a1b
parent 260429 7e44bac27dd6
child 260431 62ee103ccbbe
push id780
push userrjesup@wgate.com
push date2015-05-08 16:17 +0000
treeherdermozilla-release@62ee103ccbbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehugg, sylvestre
bugs1162251
milestone38.0
Bug 1162251: Fix WebRTC jitter buffer ignoring partial frames if the packet holds a complete NAL r=ehugg a=sylvestre
media/webrtc/trunk/webrtc/modules/video_coding/main/source/jitter_buffer.cc
--- 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
@@ -638,24 +638,22 @@ VCMFrameBufferEnum VCMJitterBuffer::GetF
 
   // Handle the 2 1 3 4 case (where 2 3 4 are frame 2 with the timestamp)
   // from above, for complete nalu's (single-nalus) only.
 
   // TODO(jesup) To handle a sequence of fragmented nalus which all are
   // slices of the same lower-case frame (timestamp), the more complete
   // solution for FindFrame that uses the seqNum and can move packets
   // between sessions would be needed.
-  if (packet.completeNALU != kNaluComplete) {
-    *frame = incomplete_frames_.FindFrame(packet.seqNum, packet.timestamp);
-    if (*frame)
-      return kNoError;
-    *frame = decodable_frames_.FindFrame(packet.seqNum, packet.timestamp);
-    if (*frame && (*frame)->GetState() != kStateComplete)
-      return kNoError;
-  }
+  *frame = incomplete_frames_.FindFrame(packet.seqNum, packet.timestamp);
+  if (*frame)
+    return kNoError;
+  *frame = decodable_frames_.FindFrame(packet.seqNum, packet.timestamp);
+  if (*frame && (*frame)->GetState() != kStateComplete)
+    return kNoError;
 
   // No match, return empty frame.
   *frame = GetEmptyFrame();
   VCMFrameBufferEnum ret = kNoError;
   if (!*frame) {
     // No free frame! Try to reclaim some...
     LOG(LS_WARNING) << "Unable to get empty frame; Recycling.";
     bool found_key_frame = RecycleFramesUntilKeyFrame();