Bug 1653626: Lock here to prevent races. r=dminor
authorByron Campen [:bwc] <docfaraday@gmail.com>
Mon, 03 Aug 2020 15:23:35 +0000
changeset 3102963 92b26e0e63416e030f332a218e20aca4221d9e54
parent 3102962 11f0f54c6e0a641470e6fba29733b3ab764df3ef
child 3102964 f39ddb6e8d4c93783a7dcda28d198635f4573493
push id578529
push userreviewbot
push dateTue, 04 Aug 2020 02:36:56 +0000
treeherdertry@538c88f9f9fe [default view] [failures only]
reviewersdminor
bugs1653626
milestone81.0a1
Bug 1653626: Lock here to prevent races. r=dminor Differential Revision: https://phabricator.services.mozilla.com/D85295
media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
--- a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -254,16 +254,17 @@ bool RTCPReceiver::NTP(uint32_t* receive
     *rtcp_arrival_time_frac = last_received_sr_ntp_.fractions();
 
   return true;
 }
 
 void RTCPReceiver::RemoteRTCPSenderInfo(uint32_t* packet_count,
                                         uint32_t* octet_count,
                                         NtpTime* ntp_timestamp) const {
+  rtc::CritScope lock(&rtcp_receiver_lock_);
   *packet_count = remote_sender_packet_count_;
   *octet_count = remote_sender_octet_count_;
   *ntp_timestamp = remote_sender_ntp_time_;
 }
 
 bool RTCPReceiver::LastReceivedXrReferenceTimeInfo(
     rtcp::ReceiveTimeInfo* info) const {
   RTC_DCHECK(info);