Index: webrtc/voice_engine/channel.cc |
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc |
index 5f29fe401efbcc8c46e96d0c9174f78dd1dc3075..2bc07dcccb91666bc852c5e5c31b55b7863c1712 100644 |
--- a/webrtc/voice_engine/channel.cc |
+++ b/webrtc/voice_engine/channel.cc |
@@ -2742,23 +2742,26 @@ void Channel::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { |
rtcp_rtt_stats_proxy_->SetRtcpRttStats(rtcp_rtt_stats); |
} |
-void Channel::UpdateOverheadForEncoder() { |
+void Channel::UpdateOverheadForEncoder(size_t 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(); |
+ UpdateOverheadForEncoder(transport_overhead_per_packet_ + |
+ rtp_overhead_per_packet_); |
} |
void Channel::OnOverheadChanged(size_t overhead_bytes_per_packet) { |
the sun
2017/02/28 11:13:10
Please add:
// TODO(solenberg): Make AudioSendStre
hbos
2017/02/28 11:44:55
Done.
|
+ rtc::CritScope cs(&overhead_per_packet_lock_); |
rtp_overhead_per_packet_ = overhead_bytes_per_packet; |
- UpdateOverheadForEncoder(); |
+ UpdateOverheadForEncoder(transport_overhead_per_packet_ + |
+ rtp_overhead_per_packet_); |
} |
int Channel::GetNetworkStatistics(NetworkStatistics& stats) { |