diff --git a/audio/channel_receive.cc b/audio/channel_receive.cc index 8b3c924e0a..dcc2d251de 100644 --- a/audio/channel_receive.cc +++ b/audio/channel_receive.cc @@ -797,10 +797,14 @@ CallReceiveStatistics ChannelReceive::GetRTCPStatistics() const { absl::optional rtcp_sr_stats = rtp_rtcp_->GetSenderReportStats(); if (rtcp_sr_stats.has_value()) { + // Number of seconds since 1900 January 1 00:00 GMT (see + // https://tools.ietf.org/html/rfc868). + constexpr int64_t kNtpJan1970Millisecs = + 2208988800 * rtc::kNumMillisecsPerSec; stats.last_sender_report_timestamp_ms = - rtcp_sr_stats->last_arrival_timestamp.ToMs(); + rtcp_sr_stats->last_arrival_timestamp.ToMs() - kNtpJan1970Millisecs; stats.last_sender_report_remote_timestamp_ms = - rtcp_sr_stats->last_remote_timestamp.ToMs(); + rtcp_sr_stats->last_remote_timestamp.ToMs() - kNtpJan1970Millisecs; stats.sender_reports_packets_sent = rtcp_sr_stats->packets_sent; stats.sender_reports_bytes_sent = rtcp_sr_stats->bytes_sent; stats.sender_reports_reports_count = rtcp_sr_stats->reports_count; diff --git a/audio/channel_receive.h b/audio/channel_receive.h index 261357d578..c55968b55f 100644 --- a/audio/channel_receive.h +++ b/audio/channel_receive.h @@ -58,7 +58,7 @@ struct CallReceiveStatistics { int64_t payload_bytes_rcvd = 0; int64_t header_and_padding_bytes_rcvd = 0; int packetsReceived; - // The capture ntp time (in local timebase) of the first played out audio + // The capture NTP time (in local timebase) of the first played out audio // frame. int64_t capture_start_ntp_time_ms_; // The timestamp at which the last packet was received, i.e. the time of the @@ -66,6 +66,8 @@ struct CallReceiveStatistics { // https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-lastpacketreceivedtimestamp absl::optional last_packet_received_timestamp_ms; // Remote outbound stats derived by the received RTCP sender reports. + // Note that the timestamps below correspond to the time elapsed since the + // Unix epoch. // https://w3c.github.io/webrtc-stats/#remoteoutboundrtpstats-dict* absl::optional last_sender_report_timestamp_ms; absl::optional last_sender_report_remote_timestamp_ms;