Index: webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc |
diff --git a/webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc b/webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc |
index 9c5d3b939d951c6ee8ac9d20c7a62cd5ea573b35..1e679af914b3664746971037a6a2b7cc7a60f0bc 100644 |
--- a/webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc |
+++ b/webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc |
@@ -39,16 +39,16 @@ const size_t rampSize = sizeof(rampArray)/sizeof(rampArray[0]); |
} // namespace |
namespace webrtc { |
-void CalculateEnergy(AudioFrame& audioFrame) |
+uint32_t CalculateEnergy(const AudioFrame& audioFrame) |
hlundin-webrtc
2016/01/19 08:25:02
Would you consider changing this to an int? I know
|
{ |
- audioFrame.energy_ = 0; |
+ uint32_t energy = 0; |
for(size_t position = 0; position < audioFrame.samples_per_channel_; |
position++) |
{ |
// TODO(andrew): this can easily overflow. |
- audioFrame.energy_ += audioFrame.data_[position] * |
- audioFrame.data_[position]; |
+ energy += audioFrame.data_[position] * audioFrame.data_[position]; |
} |
+ return energy; |
} |
void RampIn(AudioFrame& audioFrame) |