diff --git a/audio/channel_receive.cc b/audio/channel_receive.cc index 1626dd2f5b..ac02482427 100644 --- a/audio/channel_receive.cc +++ b/audio/channel_receive.cc @@ -299,9 +299,7 @@ ChannelReceive::ChannelReceive( rtp_receive_statistics_->EnableRetransmitDetection(remote_ssrc_, true); RtpRtcp::Configuration configuration; configuration.audio = true; - // TODO(nisse): Also set receiver_only = true, but that seems to break RTT - // estimation, resulting in test failures for - // PeerConnectionIntegrationTest.GetCaptureStartNtpTimeWithOldStatsApi + configuration.receiver_only = true; configuration.outgoing_transport = rtcp_send_transport; configuration.receive_statistics = rtp_receive_statistics_.get(); @@ -779,6 +777,8 @@ int64_t ChannelReceive::GetRTT() const { int64_t avg_rtt = 0; int64_t max_rtt = 0; int64_t min_rtt = 0; + // TODO(nisse): This method computes RTT based on sender reports, even though + // a receive stream is not supposed to do that. if (_rtpRtcpModule->RTT(remote_ssrc_, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 0) { return 0; diff --git a/modules/rtp_rtcp/source/rtcp_receiver.cc b/modules/rtp_rtcp/source/rtcp_receiver.cc index 202d42d7e2..3635c4aa02 100644 --- a/modules/rtp_rtcp/source/rtcp_receiver.cc +++ b/modules/rtp_rtcp/source/rtcp_receiver.cc @@ -504,7 +504,14 @@ void RTCPReceiver::HandleReportBlock(const ReportBlock& report_block, // If no SR has been received yet, the field is set to zero. // Receiver rtp_rtcp module is not expected to calculate rtt using // Sender Reports even if it accidentally can. - if (!receiver_only_ && send_time_ntp != 0) { + + // TODO(nisse): Use this way to determine the RTT only when |receiver_only_| + // is false. However, that currently breaks the tests of the + // googCaptureStartNtpTimeMs stat for audio receive streams. To fix, either + // delete all dependencies on RTT measurements for audio receive streams, or + // ensure that audio receive streams that need RTT and stats that depend on it + // are configured with an associated audio send stream. + if (send_time_ntp != 0) { uint32_t delay_ntp = report_block.delay_since_last_sr(); // Local NTP time. uint32_t receive_time_ntp =