Clear FrameBuffer if there were no frames received for 10 minutes

This is a workaround for the case when there are no video frames in a
call for a very long time, such that RTP timestamps wraparound and
FrameBuffer can't figure out if the frame is older or newer.

Bug: webrtc:9974
Change-Id: Ie1eaa4938813dbbd637ddcbe7ff118ead2bfa4a9
Reviewed-on: https://webrtc-review.googlesource.com/c/109882
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25548}
This commit is contained in:
Ilya Nikolaevskiy
2018-11-07 14:32:28 +01:00
committed by Commit Bot
parent b768e8800f
commit e6a2d94eca
4 changed files with 25 additions and 0 deletions

View File

@ -113,6 +113,9 @@ FrameBuffer::ReturnReason FrameBuffer::NextFrame(
if (keyframe_required && !frame->is_keyframe())
continue;
// TODO(https://bugs.webrtc.org/9974): consider removing this check
// as it may make a stream undecodable after a very long delay between
// frames.
if (last_decoded_frame_timestamp_ &&
AheadOf(*last_decoded_frame_timestamp_, frame->Timestamp())) {
continue;
@ -244,6 +247,11 @@ void FrameBuffer::Stop() {
new_continuous_frame_event_.Set();
}
void FrameBuffer::Clear() {
rtc::CritScope lock(&crit_);
ClearFramesAndHistory();
}
void FrameBuffer::UpdateRtt(int64_t rtt_ms) {
rtc::CritScope lock(&crit_);
jitter_estimator_->UpdateRtt(rtt_ms);