The webrtc::AudioFrame struct contains a variable energy_. Since the energy isn't always calculated when the frame is created, this change makes the CalculateEnergy method in Audio Conference Mixer always calculate the energy.

This part of the the aftermath of issue 3255.

BUG=3255
R=andrew@webrtc.org, henrike@webrtc.org, turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/16479004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6117 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org 2014-05-13 08:50:02 +00:00
parent e9a604accd
commit 4d363ae305
2 changed files with 4 additions and 4 deletions

View File

@ -41,10 +41,6 @@ const int rampSize = sizeof(rampArray)/sizeof(rampArray[0]);
namespace webrtc {
void CalculateEnergy(AudioFrame& audioFrame)
{
if(audioFrame.energy_ != 0xffffffff)
{
return;
}
audioFrame.energy_ = 0;
for(int position = 0; position < audioFrame.samples_per_channel_;
position++)

View File

@ -691,6 +691,10 @@ class AudioFrame {
int num_channels_;
SpeechType speech_type_;
VADActivity vad_activity_;
// Note that there is no guarantee that |energy_| is correct. Any user of this
// member must verify that the value is correct.
// TODO(henrike) Remove |energy_|.
// See https://code.google.com/p/webrtc/issues/detail?id=3315.
uint32_t energy_;
bool interleaved_;