Index: webrtc/call/call.cc |
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc |
index b1424531d6060a11d4812b20b74950e681b781b1..bfe6af695c3b5d36fadf68f43c66d047b951ad26 100644 |
--- a/webrtc/call/call.cc |
+++ b/webrtc/call/call.cc |
@@ -101,11 +101,7 @@ class Call : public webrtc::Call, public PacketReceiver { |
Call::Config config_; |
rtc::ThreadChecker configuration_thread_checker_; |
- // Needs to be held while write-locking |receive_crit_| or |send_crit_|. This |
- // ensures that we have a consistent network state signalled to all senders |
- // and receivers. |
- rtc::CriticalSection network_enabled_crit_; |
- bool network_enabled_ GUARDED_BY(network_enabled_crit_); |
+ bool network_enabled_; |
rtc::scoped_ptr<RWLockWrapper> receive_crit_; |
// Audio and Video receive streams are owned by the client that creates them. |
@@ -202,7 +198,6 @@ webrtc::AudioSendStream* Call::CreateAudioSendStream( |
RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
AudioSendStream* send_stream = new AudioSendStream(config); |
{ |
- rtc::CritScope lock(&network_enabled_crit_); |
WriteLockScoped write_lock(*send_crit_); |
RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) == |
audio_send_ssrcs_.end()); |
@@ -284,9 +279,6 @@ webrtc::VideoSendStream* Call::CreateVideoSendStream( |
congestion_controller_.get(), config, encoder_config, |
suspended_video_send_ssrcs_); |
- // This needs to be taken before send_crit_ as both locks need to be held |
- // while changing network state. |
- rtc::CritScope lock(&network_enabled_crit_); |
WriteLockScoped write_lock(*send_crit_); |
for (uint32_t ssrc : config.rtp.ssrcs) { |
RTC_DCHECK(video_send_ssrcs_.find(ssrc) == video_send_ssrcs_.end()); |
@@ -344,9 +336,6 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( |
num_cpu_cores_, congestion_controller_.get(), config, |
config_.voice_engine, module_process_thread_.get(), call_stats_.get()); |
- // This needs to be taken before receive_crit_ as both locks need to be held |
- // while changing network state. |
- rtc::CritScope lock(&network_enabled_crit_); |
WriteLockScoped write_lock(*receive_crit_); |
RTC_DCHECK(video_receive_ssrcs_.find(config.rtp.remote_ssrc) == |
video_receive_ssrcs_.end()); |
@@ -450,9 +439,6 @@ void Call::SetBitrateConfig( |
void Call::SignalNetworkState(NetworkState state) { |
RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
- // Take crit for entire function, it needs to be held while updating streams |
- // to guarantee a consistent state across streams. |
- rtc::CritScope lock(&network_enabled_crit_); |
network_enabled_ = state == kNetworkUp; |
congestion_controller_->SignalNetworkState(state); |
{ |