From 76a44d5dafa4114c52c55d5dd84de3f4f02dc95b Mon Sep 17 00:00:00 2001 From: terelius Date: Fri, 29 Jul 2016 12:38:39 -0700 Subject: [PATCH] Log current time if we stop logging before stop_time_. This happens if we stop logging because we have reached the file size limit. The large timestamp causes problems in the analysis tool. BUG=webrtc:6138 Review-Url: https://codereview.webrtc.org/2175713002 Cr-Commit-Position: refs/heads/master@{#13581} --- webrtc/call/rtc_event_log_helper_thread.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webrtc/call/rtc_event_log_helper_thread.cc b/webrtc/call/rtc_event_log_helper_thread.cc index b1b6990a24..c0f8972631 100644 --- a/webrtc/call/rtc_event_log_helper_thread.cc +++ b/webrtc/call/rtc_event_log_helper_thread.cc @@ -224,7 +224,11 @@ void RtcEventLogHelperThread::StopLogFile() { output_string_.clear(); rtclog::Event end_event; - end_event.set_timestamp_us(stop_time_); + // This function can be called either because we have reached the stop time, + // or because we have reached the log file size limit. Therefore, use the + // current time if we have not reached the time limit. + end_event.set_timestamp_us( + std::min(stop_time_, clock_->TimeInMicroseconds())); end_event.set_type(rtclog::Event::LOG_END); AppendEventToString(&end_event);