Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: video/video_receive_stream.cc

Issue 3017613002: Continuously request keyframes if decoding does not recover. (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « video/video_receive_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: video/video_receive_stream.cc
diff --git a/video/video_receive_stream.cc b/video/video_receive_stream.cc
index 7de42f8a1da8dd6f1310f21c2034c655dff1a6ba..891c78e7ec7cd13f75bcc09f19896cda8ad1bc1b 100644
--- a/video/video_receive_stream.cc
+++ b/video/video_receive_stream.cc
@@ -410,16 +410,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);
« no previous file with comments | « video/video_receive_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698