From 891419f8e8a1b0fa2d53c887a033693652ff7d28 Mon Sep 17 00:00:00 2001 From: nisse Date: Thu, 12 Jan 2017 10:02:22 -0800 Subject: [PATCH] Treat negative ntp time as unset. The video send pipeline uses the magic value 0 for an unset ntp time. However, the receive pipeline uses the magic value -1 for unset (unclear where, it seems it behaved differently a few months ago). This makes cl https://codereview.webrtc.org/2469993003/ fail the P2PTestConductor.ForwardVideoOnlyStream, because that cl removes code which always clears the ntp time, and enables propagation of ntp time from the receive pipeline to the send pipeline. Treating ntp time <= 0 as unset is a small improvement. Ultimately, a VideoFrame shouldn't carry an ntp time at all. BUG=webrtc:5740,webrtc:6977 Review-Url: https://codereview.webrtc.org/2620383005 Cr-Commit-Position: refs/heads/master@{#16035} --- webrtc/video/vie_encoder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc index f78633d532..adf8fe7eb4 100644 --- a/webrtc/video/vie_encoder.cc +++ b/webrtc/video/vie_encoder.cc @@ -464,7 +464,7 @@ void ViEEncoder::OnFrame(const VideoFrame& video_frame) { // Capture time may come from clock with an offset and drift from clock_. int64_t capture_ntp_time_ms; - if (video_frame.ntp_time_ms() != 0) { + if (video_frame.ntp_time_ms() > 0) { capture_ntp_time_ms = video_frame.ntp_time_ms(); } else if (video_frame.render_time_ms() != 0) { capture_ntp_time_ms = video_frame.render_time_ms() + delta_ntp_internal_ms_;