From 1c7bfe02f7799801339d8790074ae2346f7917e4 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Thu, 26 Apr 2012 00:20:28 +0000 Subject: [PATCH] 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 --- src/voice_engine/main/source/audio_frame_operations.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/voice_engine/main/source/audio_frame_operations.cc b/src/voice_engine/main/source/audio_frame_operations.cc index 2ff80680e..0080dcc92 100644 --- a/src/voice_engine/main/source/audio_frame_operations.cc +++ b/src/voice_engine/main/source/audio_frame_operations.cc @@ -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];