Drop VP8 frames in case of duplicates in RtpFrameReferenceFinder.

BUG=webrtc:5514

Review-Url: https://codereview.webrtc.org/2734453002
Cr-Commit-Position: refs/heads/master@{#17090}
This commit is contained in:
philipel
2017-03-07 03:54:05 -08:00
committed by Commit bot
parent 2150ac2a43
commit 57f19cc0cd
2 changed files with 30 additions and 2 deletions

View File

@ -334,8 +334,15 @@ void RtpFrameReferenceFinder::ManageFrameVp8(
return;
}
RTC_DCHECK((AheadOf<uint16_t, kPicIdLength>(frame->picture_id,
layer_info_it->second[layer])));
if (!(AheadOf<uint16_t, kPicIdLength>(frame->picture_id,
layer_info_it->second[layer]))) {
LOG(LS_WARNING) << "Frame with picture id " << frame->picture_id
<< " and packet range [" << frame->first_seq_num() << ", "
<< frame->last_seq_num() << "] already received, "
<< " dropping frame.";
return;
}
++frame->num_references;
frame->references[layer] = layer_info_it->second[layer];
}

View File

@ -428,6 +428,27 @@ TEST_F(TestRtpFrameReferenceFinder, Vp8TemporalLayers_0) {
CheckReferencesVp8(pid + 3, pid + 2);
}
TEST_F(TestRtpFrameReferenceFinder, Vp8DuplicateTl1Frames) {
uint16_t pid = Rand();
uint16_t sn = Rand();
InsertVp8(sn, sn, true, pid, 0, 0);
InsertVp8(sn + 1, sn + 1, false, pid + 1, 1, 0, true);
InsertVp8(sn + 2, sn + 2, false, pid + 2, 0, 1);
InsertVp8(sn + 3, sn + 3, false, pid + 3, 1, 1);
InsertVp8(sn + 3, sn + 3, false, pid + 3, 1, 1);
InsertVp8(sn + 4, sn + 4, false, pid + 4, 0, 2);
InsertVp8(sn + 5, sn + 5, false, pid + 5, 1, 2);
ASSERT_EQ(6UL, frames_from_callback_.size());
CheckReferencesVp8(pid);
CheckReferencesVp8(pid + 1, pid);
CheckReferencesVp8(pid + 2, pid);
CheckReferencesVp8(pid + 3, pid + 1, pid + 2);
CheckReferencesVp8(pid + 4, pid + 2);
CheckReferencesVp8(pid + 5, pid + 3, pid + 4);
}
// Test with 1 temporal layer.
TEST_F(TestRtpFrameReferenceFinder, Vp8TemporalLayersReordering_0) {
uint16_t pid = Rand();