Init GainControlImpl with correct lock.

GainControlImpl was inited with two refs to the APM capture lock. As a
result, it could modify member vars without holding the render
lock. The Process and Analyze calls are not affected, because they are
made from audio_processing_impl when APM holds both locks.

Bug: webrtc:9354
Change-Id: I814b69602280921dda9dc45ffcbddb38de4a3394
Reviewed-on: https://webrtc-review.googlesource.com/84182
Reviewed-by: Max Morin <maxmorin@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23677}
This commit is contained in:
Alex Loiko
2018-06-19 17:09:43 +02:00
committed by Commit Bot
parent 5565981e17
commit 80c0f06d63

View File

@ -402,7 +402,7 @@ AudioProcessingImpl::AudioProcessingImpl(
public_submodules_->echo_control_mobile.reset( public_submodules_->echo_control_mobile.reset(
new EchoControlMobileImpl(&crit_render_, &crit_capture_)); new EchoControlMobileImpl(&crit_render_, &crit_capture_));
public_submodules_->gain_control.reset( public_submodules_->gain_control.reset(
new GainControlImpl(&crit_capture_, &crit_capture_)); new GainControlImpl(&crit_render_, &crit_capture_));
public_submodules_->level_estimator.reset( public_submodules_->level_estimator.reset(
new LevelEstimatorImpl(&crit_capture_)); new LevelEstimatorImpl(&crit_capture_));
public_submodules_->noise_suppression.reset( public_submodules_->noise_suppression.reset(