From d268d6ffbee619a19a68fa853b2abe97a9a85742 Mon Sep 17 00:00:00 2001 From: philipel Date: Thu, 15 Sep 2016 13:43:13 +0200 Subject: [PATCH] Stash non layer-sync frames if we have not yet received an earlier frame for this layer. In VP8 the assumption is that a non layer-sync frame depends on all previous frames on temporal layers less or equal to this frames temporal layer. BUG=webrtc:5514 R=stefan@webrtc.org Review URL: https://codereview.webrtc.org/2306513003 . Cr-Commit-Position: refs/heads/master@{#14229} --- webrtc/modules/video_coding/rtp_frame_reference_finder.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/video_coding/rtp_frame_reference_finder.cc b/webrtc/modules/video_coding/rtp_frame_reference_finder.cc index 218a52d880..d687a99924 100644 --- a/webrtc/modules/video_coding/rtp_frame_reference_finder.cc +++ b/webrtc/modules/video_coding/rtp_frame_reference_finder.cc @@ -291,7 +291,12 @@ void RtpFrameReferenceFinder::ManageFrameVp8( // Find all references for this frame. frame->num_references = 0; for (uint8_t layer = 0; layer <= codec_header.temporalIdx; ++layer) { - RTC_DCHECK_NE(-1, layer_info_it->second[layer]); + // If we have not yet received a previous frame on this temporal layer, + // stash this frame. + if (layer_info_it->second[layer] == -1) { + stashed_frames_.push_back(std::move(frame)); + return; + } // If we have not yet received a frame between this frame and the referenced // frame then we have to wait for that frame to be completed first.