From 3c95af093dcea6f6a8c3fdcbed9b0956fee1609b Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Tue, 11 Aug 2015 13:49:29 +0200 Subject: [PATCH] Bug 901633 - Part 9 - Make the necessary changes to VoEExternalMediaImpl::ExternalRecordingInsertData so that it the number of channels is forwarded down the webrtc.org code. r=jesup --- .../trunk/webrtc/voice_engine/voe_external_media_impl.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/media/webrtc/trunk/webrtc/voice_engine/voe_external_media_impl.cc b/media/webrtc/trunk/webrtc/voice_engine/voe_external_media_impl.cc index 7774529a6da..8388595b800 100644 --- a/media/webrtc/trunk/webrtc/voice_engine/voe_external_media_impl.cc +++ b/media/webrtc/trunk/webrtc/voice_engine/voe_external_media_impl.cc @@ -214,7 +214,10 @@ int VoEExternalMediaImpl::ExternalRecordingInsertData( } uint16_t blockSize = samplingFreqHz / 100; - uint32_t nBlocks = lengthSamples / blockSize; + // We know the number of samples for 10ms of audio, so we can derive the + // number of channels here: + uint32_t channels = lengthSamples * 100 / samplingFreqHz; + uint32_t nBlocks = lengthSamples / blockSize / channels; int16_t totalDelayMS = 0; uint16_t playoutDelayMS = 0; @@ -242,7 +245,7 @@ int VoEExternalMediaImpl::ExternalRecordingInsertData( shared_->transmit_mixer()->PrepareDemux( (const int8_t*)(&speechData10ms[i*blockSize]), blockSize, - 1, + channels, samplingFreqHz, totalDelayMS, 0,