MonoInputVolumeController: Refactor Process()
Bug: webrtc:7494 Change-Id: I609b5875ba3dbbee84aa3d481f3f359c964e6373 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280480 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Hanna Silen <silen@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38549}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
d7cfbe3843
commit
92d66be163
@ -197,19 +197,9 @@ void MonoInputVolumeController::Process(
|
||||
CheckVolumeAndReset();
|
||||
}
|
||||
|
||||
int rms_error = 0;
|
||||
bool update_gain = false;
|
||||
if (rms_error_override.has_value()) {
|
||||
if (is_first_frame_ || frames_since_update_gain_ < kOverrideWaitFrames) {
|
||||
update_gain = false;
|
||||
} else {
|
||||
rms_error = *rms_error_override;
|
||||
update_gain = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (update_gain) {
|
||||
UpdateGain(rms_error);
|
||||
if (rms_error_override.has_value() && !is_first_frame_ &&
|
||||
frames_since_update_gain_ >= kOverrideWaitFrames) {
|
||||
UpdateGain(*rms_error_override);
|
||||
}
|
||||
|
||||
is_first_frame_ = false;
|
||||
|
||||
Reference in New Issue
Block a user