Flush NetEQ when receiving payload type switches between mono and stereo.

TEST=voe_cmd_test

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1893 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tina.legrand@webrtc.org
2012-03-15 11:23:51 +00:00
parent f7d90041b0
commit 0e0390dc33
2 changed files with 8 additions and 1 deletions

View File

@@ -669,7 +669,7 @@ ACMNetEQ::RecOut(
// Check for errors that can be recovered from:
// RECOUT_ERROR_SAMPLEUNDERRUN = 2003
int errorCode = WebRtcNetEQ_GetErrorCode(_inst[0]);
int errorCode = WebRtcNetEQ_GetErrorCode(_inst[1]);
if(errorCode != 2003)
{
// Cannot recover; return an error

View File

@@ -1842,6 +1842,13 @@ AudioCodingModuleImpl::IncomingPacket(
_codecs[i]->UpdateDecoderSampFreq(i);
_netEq.SetReceivedStereo(_stereoReceive[i]);
// If we have a change in expected number of channels,
// flush packet buffers in NetEQ.
if ((_stereoReceive[i] && (_expected_channels == 1)) ||
(!_stereoReceive[i] && (_expected_channels == 2))) {
_netEq.FlushBuffers();
}
// Store number of channels we expect to receive for the
// current payload type.
if (_stereoReceive[i]) {