Fix off-by-one error when removing information about missing packet in PacketBuffer.
In the ClearTo function we risked removing one packet too many from the set of |missing_packets_|, and in the case of H264 this would cause us to create incomplete delta frames. This is turn disrupt the stream and a keyframe request has to be made. Bug: webrtc:8536 Change-Id: Ie7ccd5f1631a4cf3bd463878d5b0fe746744ec23 Reviewed-on: https://webrtc-review.googlesource.com/30141 Commit-Queue: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21119}
This commit is contained in:
@ -162,8 +162,11 @@ void PacketBuffer::ClearTo(uint16_t seq_num) {
|
||||
first_seq_num_ = seq_num;
|
||||
|
||||
is_cleared_to_first_seq_num_ = true;
|
||||
missing_packets_.erase(missing_packets_.begin(),
|
||||
missing_packets_.upper_bound(seq_num));
|
||||
auto clear_to_it = missing_packets_.upper_bound(seq_num);
|
||||
if (clear_to_it != missing_packets_.begin()) {
|
||||
--clear_to_it;
|
||||
missing_packets_.erase(missing_packets_.begin(), clear_to_it);
|
||||
}
|
||||
}
|
||||
|
||||
void PacketBuffer::Clear() {
|
||||
|
Reference in New Issue
Block a user