Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1127)

Unified Diff: webrtc/voice_engine/channel.cc

Issue 2710363003: Fix TSAN race in webrtc::voe::Channel (Closed)
Patch Set: EXCLUSIVE_LOCKS_REQUIRED used (and moved TODO to right function, whoops) Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 1d54821a50c882d1e85a7426295948c475333f0b..11e631512ca165b33c0905bd5f8381964f42ffc8 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -2779,20 +2779,24 @@ void Channel::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) {
}
void Channel::UpdateOverheadForEncoder() {
+ size_t overhead_per_packet =
+ transport_overhead_per_packet_ + rtp_overhead_per_packet_;
audio_coding_->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) {
if (*encoder) {
- (*encoder)->OnReceivedOverhead(transport_overhead_per_packet_ +
- rtp_overhead_per_packet_);
+ (*encoder)->OnReceivedOverhead(overhead_per_packet);
}
});
}
void Channel::SetTransportOverhead(size_t transport_overhead_per_packet) {
+ rtc::CritScope cs(&overhead_per_packet_lock_);
transport_overhead_per_packet_ = transport_overhead_per_packet;
UpdateOverheadForEncoder();
}
+// TODO(solenberg): Make AudioSendStream an OverheadObserver instead.
void Channel::OnOverheadChanged(size_t overhead_bytes_per_packet) {
+ rtc::CritScope cs(&overhead_per_packet_lock_);
rtp_overhead_per_packet_ = overhead_bytes_per_packet;
UpdateOverheadForEncoder();
}
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698