audio_processing/agc: Put entire method set_output_will_be_muted() under lock
Setting the member value output_will_be_muted_ in set_output_will_be_muted() was done before the lock. This caused a data race. BUG=4477 R=pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/44929004 Cr-Commit-Position: refs/heads/master@{#8877}
This commit is contained in:
@ -452,14 +452,15 @@ int AudioProcessingImpl::num_output_channels() const {
|
||||
}
|
||||
|
||||
void AudioProcessingImpl::set_output_will_be_muted(bool muted) {
|
||||
output_will_be_muted_ = muted;
|
||||
CriticalSectionScoped lock(crit_);
|
||||
output_will_be_muted_ = muted;
|
||||
if (agc_manager_.get()) {
|
||||
agc_manager_->SetCaptureMuted(output_will_be_muted_);
|
||||
}
|
||||
}
|
||||
|
||||
bool AudioProcessingImpl::output_will_be_muted() const {
|
||||
CriticalSectionScoped lock(crit_);
|
||||
return output_will_be_muted_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user