Continuously request keyframes if decoding does not recover.
This is a workaround until downstream projects have been fixed. BUG=webrtc:8220 Review-Url: https://codereview.webrtc.org/3017613002 Cr-Commit-Position: refs/heads/master@{#19966}
This commit is contained in:
@ -416,16 +416,19 @@ bool VideoReceiveStream::Decode() {
|
||||
}
|
||||
|
||||
if (frame) {
|
||||
int64_t now_ms = clock_->TimeInMilliseconds();
|
||||
RTC_DCHECK_EQ(res, video_coding::FrameBuffer::ReturnReason::kFrameFound);
|
||||
if (video_receiver_.Decode(frame.get()) == VCM_OK) {
|
||||
keyframe_required_ = false;
|
||||
frame_decoded_ = true;
|
||||
rtp_video_stream_receiver_.FrameDecoded(frame->picture_id);
|
||||
} else if (!keyframe_required_ || !frame_decoded_) {
|
||||
} else if (!frame_decoded_ || !keyframe_required_ ||
|
||||
(last_keyframe_request_ms_ + kMaxWaitForKeyFrameMs < now_ms)) {
|
||||
keyframe_required_ = true;
|
||||
// TODO(philipel): Remove this keyframe request when downstream project
|
||||
// has been fixed.
|
||||
RequestKeyFrame();
|
||||
last_keyframe_request_ms_ = now_ms;
|
||||
}
|
||||
} else {
|
||||
RTC_DCHECK_EQ(res, video_coding::FrameBuffer::ReturnReason::kTimeout);
|
||||
|
@ -159,6 +159,8 @@ class VideoReceiveStream : public webrtc::VideoReceiveStream,
|
||||
|
||||
// If we have successfully decoded any frame.
|
||||
bool frame_decoded_ = false;
|
||||
|
||||
int64_t last_keyframe_request_ms_ = 0;
|
||||
};
|
||||
} // namespace internal
|
||||
} // namespace webrtc
|
||||
|
Reference in New Issue
Block a user