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:
parent
da12dde4d2
commit
1c7bfe02f7
@ -64,6 +64,8 @@ AudioFrameOperations::StereoToMono(AudioFrame& audioFrame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AudioFrameOperations::SwapStereoChannels(AudioFrame* frame) {
|
void AudioFrameOperations::SwapStereoChannels(AudioFrame* frame) {
|
||||||
|
if (frame->_audioChannel != 2) return;
|
||||||
|
|
||||||
for (int i = 0; i < frame->_payloadDataLengthInSamples * 2; i += 2) {
|
for (int i = 0; i < frame->_payloadDataLengthInSamples * 2; i += 2) {
|
||||||
int16_t temp_data = frame->_payloadData[i];
|
int16_t temp_data = frame->_payloadData[i];
|
||||||
frame->_payloadData[i] = frame->_payloadData[i + 1];
|
frame->_payloadData[i] = frame->_payloadData[i + 1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user