Clean up old GoPs when the RTP sequence number jump.
Bug: chromium:1065699 Change-Id: I2ed853559858ef82c6eb03b366cd77e8b3b0e799 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173703 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31102}
This commit is contained in:
parent
ee0864364d
commit
00032698ac
@ -173,9 +173,9 @@ void RtpFrameReferenceFinder::UpdateLastPictureIdWithPadding(uint16_t seq_num) {
|
||||
// the keyframe they belong to due to wrapping sequence number. In order
|
||||
// to prevent this we advance the picture id of the keyframe every so often.
|
||||
if (ForwardDiff(gop_seq_num_it->first, seq_num) > 10000) {
|
||||
RTC_DCHECK_EQ(1ul, last_seq_num_gop_.size());
|
||||
last_seq_num_gop_[seq_num] = gop_seq_num_it->second;
|
||||
last_seq_num_gop_.erase(gop_seq_num_it);
|
||||
auto save = gop_seq_num_it->second;
|
||||
last_seq_num_gop_.clear();
|
||||
last_seq_num_gop_[seq_num] = save;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -308,6 +308,12 @@ TEST_F(TestRtpFrameReferenceFinder, AdvanceSavedKeyframe) {
|
||||
EXPECT_EQ(6UL, frames_from_callback_.size());
|
||||
}
|
||||
|
||||
TEST_F(TestRtpFrameReferenceFinder, AdvanceSavedKeyframeBigJump) {
|
||||
InsertVp9Flex(0, 0, true);
|
||||
InsertVp9Flex(1, 1, true);
|
||||
reference_finder_->PaddingReceived(32768);
|
||||
}
|
||||
|
||||
TEST_F(TestRtpFrameReferenceFinder, ClearTo) {
|
||||
uint16_t sn = Rand();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user