Index: webrtc/modules/audio_coding/neteq/neteq_impl.cc |
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc |
index e119d9439cfbb617f38dfe27c1a9773792f8664c..2d91b8c1c548204d8f78168cc5727feca6b23606 100644 |
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc |
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc |
@@ -1600,16 +1600,18 @@ void NetEqImpl::DoMerge(int16_t* decoded_buffer, size_t decoded_length, |
size_t new_length = merge_->Process(decoded_buffer, decoded_length, |
mute_factor_array_.get(), |
algorithm_buffer_.get()); |
- size_t expand_length_correction = new_length - |
- decoded_length / algorithm_buffer_->Channels(); |
+ // Correction can be negative. |
+ int expand_length_correction = |
+ rtc::dchecked_cast<int>(new_length) - |
+ rtc::dchecked_cast<int>(decoded_length / algorithm_buffer_->Channels()); |
// Update in-call and post-call statistics. |
if (expand_->MuteFactor(0) == 0) { |
// Expand generates only noise. |
- stats_.ExpandedNoiseSamples(expand_length_correction); |
+ stats_.ExpandedNoiseSamplesCorrection(expand_length_correction); |
} else { |
// Expansion generates more than only noise. |
- stats_.ExpandedVoiceSamples(expand_length_correction); |
+ stats_.ExpandedVoiceSamplesCorrection(expand_length_correction); |
} |
last_mode_ = kModeMerge; |