Always record timestamp of keyframe request.

Bug: chromium:1013590
Change-Id: I85b20f06cb0bec15dae199cf96512173f0faad42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159884
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29817}
diff --git a/video/video_receive_stream.cc b/video/video_receive_stream.cc
index a60bb07..a683f7d 100644
--- a/video/video_receive_stream.cc
+++ b/video/video_receive_stream.cc
@@ -535,12 +535,13 @@
   rtp_video_stream_receiver_.RequestPacketRetransmit(sequence_numbers);
 }
 
-void VideoReceiveStream::RequestKeyFrame() {
+void VideoReceiveStream::RequestKeyFrame(int64_t timestamp_ms) {
   if (config_.media_transport()) {
     config_.media_transport()->RequestKeyFrame(config_.rtp.remote_ssrc);
   } else {
     rtp_video_stream_receiver_.RequestKeyFrame();
   }
+  last_keyframe_request_ms_ = timestamp_ms;
 }
 
 void VideoReceiveStream::OnCompleteFrame(
@@ -672,14 +673,13 @@
     rtp_video_stream_receiver_.FrameDecoded(frame->id.picture_id);
 
     if (decode_result == WEBRTC_VIDEO_CODEC_OK_REQUEST_KEYFRAME)
-      RequestKeyFrame();
+      RequestKeyFrame(now_ms);
   } else if (!frame_decoded_ || !keyframe_required_ ||
              (last_keyframe_request_ms_ + max_wait_for_keyframe_ms_ < now_ms)) {
     keyframe_required_ = true;
     // TODO(philipel): Remove this keyframe request when downstream project
     //                 has been fixed.
-    RequestKeyFrame();
-    last_keyframe_request_ms_ = now_ms;
+    RequestKeyFrame(now_ms);
   }
 }
 
@@ -707,7 +707,7 @@
        rtp_video_stream_receiver_.IsDecryptable())) {
     RTC_LOG(LS_WARNING) << "No decodable frame in " << GetWaitMs()
                         << " ms, requesting keyframe.";
-    RequestKeyFrame();
+    RequestKeyFrame(now_ms);
   }
 }
 
diff --git a/video/video_receive_stream.h b/video/video_receive_stream.h
index e72c3b1..7c68563 100644
--- a/video/video_receive_stream.h
+++ b/video/video_receive_stream.h
@@ -142,7 +142,7 @@
 
   void UpdatePlayoutDelays() const
       RTC_EXCLUSIVE_LOCKS_REQUIRED(playout_delay_lock_);
-  void RequestKeyFrame();
+  void RequestKeyFrame(int64_t timestamp_ms);
 
   void UpdateHistograms();