Added registration of RED and CNG to NetEq slave.

Bug found when working on issue 221. Missing registration of CNG was the cause of the bad audio (master and slave out of sync) reported in the issue.

NOTE! File has not been refactored to follow Google style.

BUG=http://code.google.com/p/webrtc/issues/detail?id=221

Review URL: http://webrtc-codereview.appspot.com/342006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1372 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tina.legrand@webrtc.org 2012-01-10 13:59:55 +00:00
parent d1f148da77
commit ac4eb046e3

View File

@ -1536,6 +1536,27 @@ AudioCodingModuleImpl::RegisterReceiveCodec(
"Cannot Add Slave jitter buffer to NetEQ.");
return -1;
}
// Register RED and CN in slave.
bool reg_in_neteq = false;
for (int i = (ACMCodecDB::kNumCodecs - 1); i > -1; i--) {
if((STR_CASE_CMP(ACMCodecDB::database_[i].plname, "RED") == 0)) {
reg_in_neteq = true;
} else if ((STR_CASE_CMP(ACMCodecDB::database_[i].plname, "CN") == 0)) {
reg_in_neteq = true;
}
if (reg_in_neteq) {
if(RegisterRecCodecMSSafe(ACMCodecDB::database_[i], i, i,
ACMNetEQ::slaveJB) < 0) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, _id,
"Cannot register slave codec.");
return -1;
}
_registeredPlTypes[i] = ACMCodecDB::database_[i].pltype;
reg_in_neteq = false;
}
}
}
if(RegisterRecCodecMSSafe(receiveCodec, codecId, mirrorId,