Fail silently when swapping mono.

TBR=tina.legrand@webrtc.org
BUG=issue451
TEST=forthcoming unittest

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2121 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org 2012-04-26 00:20:28 +00:00
parent da12dde4d2
commit 1c7bfe02f7

View File

@ -64,6 +64,8 @@ AudioFrameOperations::StereoToMono(AudioFrame& audioFrame)
}
void AudioFrameOperations::SwapStereoChannels(AudioFrame* frame) {
if (frame->_audioChannel != 2) return;
for (int i = 0; i < frame->_payloadDataLengthInSamples * 2; i += 2) {
int16_t temp_data = frame->_payloadData[i];
frame->_payloadData[i] = frame->_payloadData[i + 1];