Index: webrtc/modules/video_coding/video_receiver.cc |
diff --git a/webrtc/modules/video_coding/video_receiver.cc b/webrtc/modules/video_coding/video_receiver.cc |
index de6764f9b54e1cd23522f6d5837bf0242420dbad..3d3e155dc3e1a6417cc5a255f5406603435a76a7 100644 |
--- a/webrtc/modules/video_coding/video_receiver.cc |
+++ b/webrtc/modules/video_coding/video_receiver.cc |
@@ -320,7 +320,24 @@ |
if (decoder == nullptr) { |
return VCM_NO_CODEC_REGISTERED; |
} |
- return decoder->Decode(frame, clock_->TimeInMilliseconds()); |
+ // Decode a frame |
+ int32_t ret = decoder->Decode(frame, clock_->TimeInMilliseconds()); |
+ |
+ // Check for failed decoding, run frame type request callback if needed. |
+ bool request_key_frame = false; |
+ if (ret < 0) { |
+ request_key_frame = true; |
+ } |
+ |
+ if (!frame.Complete() || frame.MissingFrame()) { |
+ request_key_frame = true; |
+ ret = VCM_OK; |
+ } |
+ if (request_key_frame) { |
+ rtc::CritScope cs(&process_crit_); |
+ _scheduleKeyRequest = true; |
+ } |
+ return ret; |
} |
// Register possible receive codecs, can be called multiple times |