Resolves memcheck issue in AudioCodingModuleTest. The issue is coditional jumnp based on uninitialized variable.
BUG=2944
R=andrew@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/8919004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5579 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/main/test/Channel.cc b/webrtc/modules/audio_coding/main/test/Channel.cc
index 8296d2a..d32735e 100644
--- a/webrtc/modules/audio_coding/main/test/Channel.cc
+++ b/webrtc/modules/audio_coding/main/test/Channel.cc
@@ -120,6 +120,7 @@
return status;
}
+// TODO(turajs): rewite this method.
void Channel::CalcStatistics(WebRtcRTPHeader& rtpInfo, uint16_t payloadSize) {
int n;
if ((rtpInfo.header.payloadType != _lastPayloadType)
@@ -188,6 +189,8 @@
currentPayloadStr->lastPayloadLenByte = payloadSize;
currentPayloadStr->lastTimestamp = rtpInfo.header.timestamp;
currentPayloadStr->payloadType = rtpInfo.header.payloadType;
+ memset(currentPayloadStr->frameSizeStats, 0,
+ sizeof(ACMTestPayloadStats::frameSizeStats));
}
} else {
n = 0;
@@ -199,6 +202,8 @@
_payloadStats[n].lastPayloadLenByte = payloadSize;
_payloadStats[n].lastTimestamp = rtpInfo.header.timestamp;
_payloadStats[n].payloadType = rtpInfo.header.payloadType;
+ memset(_payloadStats[n].frameSizeStats, 0,
+ sizeof(ACMTestPayloadStats::frameSizeStats));
}
}
diff --git a/webrtc/modules/audio_coding/main/test/Channel.h b/webrtc/modules/audio_coding/main/test/Channel.h
index 27b2cfb..7611c9d 100644
--- a/webrtc/modules/audio_coding/main/test/Channel.h
+++ b/webrtc/modules/audio_coding/main/test/Channel.h
@@ -24,6 +24,7 @@
#define MAX_NUM_PAYLOADS 50
#define MAX_NUM_FRAMESIZES 6
+// TODO(turajs): Write constructor for this structure.
struct ACMTestFrameSizeStats {
uint16_t frameSizeSample;
int16_t maxPayloadLen;
@@ -34,6 +35,7 @@
double usageLenSec;
};
+// TODO(turajs): Write constructor for this structure.
struct ACMTestPayloadStats {
bool newPacket;
int16_t payloadType;