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(); |
} |