diff --git a/src/voice_engine/main/source/channel.cc b/src/voice_engine/main/source/channel.cc index fb87b14ea..37ad145c1 100644 --- a/src/voice_engine/main/source/channel.cc +++ b/src/voice_engine/main/source/channel.cc @@ -918,20 +918,7 @@ WebRtc_Word32 Channel::GetAudioFrame(const WebRtc_Word32 id, if (_outputFileRecording && _outputFileRecorderPtr) { - if(audioFrame._audioChannel == 2) - { - AudioFrame temp = audioFrame; - AudioFrameOperations::StereoToMono (temp); - _outputFileRecorderPtr->RecordAudioToFile(temp); - } - else if(audioFrame._audioChannel == 1) - { - _outputFileRecorderPtr->RecordAudioToFile(audioFrame); - } - else - { - assert(false); - } + _outputFileRecorderPtr->RecordAudioToFile(audioFrame); } } @@ -3902,7 +3889,8 @@ int Channel::StartRecordingPlayout(const char* fileName, const WebRtc_UWord32 notificationTime(0); // Not supported in VoE CodecInst dummyCodec={100,"L16",16000,320,1,320000}; - if (codecInst != NULL && codecInst->channels != 1) + if (codecInst != NULL && + (codecInst->channels < 1) || (codecInst->channels > 2)) { _engineStatisticsPtr->SetLastError( VE_BAD_ARGUMENT, kTraceError, diff --git a/src/voice_engine/main/source/output_mixer.cc b/src/voice_engine/main/source/output_mixer.cc index 2764f78ea..a2841b230 100644 --- a/src/voice_engine/main/source/output_mixer.cc +++ b/src/voice_engine/main/source/output_mixer.cc @@ -342,7 +342,8 @@ int OutputMixer::StartRecordingPlayout(const char* fileName, const WebRtc_UWord32 notificationTime(0); CodecInst dummyCodec={100,"L16",16000,320,1,320000}; - if (codecInst != NULL && codecInst->channels != 1) + if (codecInst != NULL && + (codecInst->channels < 1) || (codecInst->channels > 2)) { _engineStatisticsPtr->SetLastError( VE_BAD_ARGUMENT, kTraceError, @@ -529,8 +530,6 @@ OutputMixer::GetMixedAudio(const WebRtc_Word32 desiredFreqHz, CriticalSectionScoped cs(&_fileCritSect); if (_outputFileRecording) { - assert(audioFrame._audioChannel == 1); - if (_outputFileRecorderPtr) { _outputFileRecorderPtr->RecordAudioToFile(audioFrame); diff --git a/src/voice_engine/main/source/voe_file_impl.cc b/src/voice_engine/main/source/voe_file_impl.cc index cd3193fd6..637dce733 100644 --- a/src/voice_engine/main/source/voe_file_impl.cc +++ b/src/voice_engine/main/source/voe_file_impl.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -469,8 +469,8 @@ int VoEFileImpl::StartRecordingPlayout( } if (channel == -1) { - _outputMixerPtr->StartRecordingPlayout(fileNameUTF8, compression); - return 0; + return _outputMixerPtr->StartRecordingPlayout + (fileNameUTF8, compression); } else {