diff --git a/src/modules/audio_coding/main/source/acm_g7291.cc b/src/modules/audio_coding/main/source/acm_g7291.cc index 043beb2c5..d832e9c7a 100644 --- a/src/modules/audio_coding/main/source/acm_g7291.cc +++ b/src/modules/audio_coding/main/source/acm_g7291.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 @@ -44,7 +44,10 @@ namespace webrtc { ACMG729_1::ACMG729_1( WebRtc_Word16 /* codecID */) : _encoderInstPtr(NULL), - _decoderInstPtr(NULL) { + _decoderInstPtr(NULL), + _myRate(32000), + _flag8kHz(0), + _flagG729mode(0) { return; } @@ -163,22 +166,16 @@ ACMG729_1::SetBitRateSafe( struct G729_1_inst_t_; -ACMG729_1::ACMG729_1( - WebRtc_Word16 codecID): -_encoderInstPtr(NULL), -_decoderInstPtr(NULL) -{ - _codecID = codecID; - // Our current G729.1 does not support Annex C - // which is DTX. - _hasInternalDTX = false; - - // Default rate - _myRate = 32000; - - _flag8kHz = 0; - _flagG729mode = 0; - return; +ACMG729_1::ACMG729_1(WebRtc_Word16 codecID) + : _encoderInstPtr(NULL), + _decoderInstPtr(NULL), + _myRate(32000), // Default rate. + _flag8kHz(0), + _flagG729mode(0) { + // TODO(tlegrand): We should add codecID as a input variable to the + // constructor of ACMGenericCodec. + _codecID = codecID; + return; } ACMG729_1::~ACMG729_1() diff --git a/src/modules/audio_coding/main/source/acm_speex.cc b/src/modules/audio_coding/main/source/acm_speex.cc index 1f75e94ee..acb2a3b27 100644 --- a/src/modules/audio_coding/main/source/acm_speex.cc +++ b/src/modules/audio_coding/main/source/acm_speex.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 @@ -54,7 +54,12 @@ namespace webrtc { #ifndef WEBRTC_CODEC_SPEEX ACMSPEEX::ACMSPEEX(WebRtc_Word16 /* codecID*/) : _encoderInstPtr(NULL), - _decoderInstPtr(NULL) { + _decoderInstPtr(NULL), + _complMode(0), + _vbrEnabled(false), + _encodingRate(-1), + _samplingFrequency(-1), + _samplesIn20MsAudio(-1) { return; } diff --git a/src/modules/audio_coding/main/source/audio_coding_module_impl.cc b/src/modules/audio_coding/main/source/audio_coding_module_impl.cc index 77ed9ecf2..2abe46b7e 100644 --- a/src/modules/audio_coding/main/source/audio_coding_module_impl.cc +++ b/src/modules/audio_coding/main/source/audio_coding_module_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 @@ -1191,9 +1191,8 @@ match"); } else { // Copy payload data for future use. size_t length = static_cast( - audioFrame._payloadDataLengthInSamples * audio_channels * - sizeof(WebRtc_UWord16)); - memcpy(audio, audioFrame._payloadData, length); + audioFrame._payloadDataLengthInSamples * audio_channels); + memcpy(audio, audioFrame._payloadData, length * sizeof(WebRtc_UWord16)); } WebRtc_UWord32 currentTimestamp;