diff --git a/webrtc/modules/audio_coding/codecs/g722/g722_interface.c b/webrtc/modules/audio_coding/codecs/g722/g722_interface.c index 9a67d88af..d06c588d0 100644 --- a/webrtc/modules/audio_coding/codecs/g722/g722_interface.c +++ b/webrtc/modules/audio_coding/codecs/g722/g722_interface.c @@ -86,7 +86,7 @@ int16_t WebRtcG722_FreeDecoder(G722DecInst *G722dec_inst) } int16_t WebRtcG722_Decode(G722DecInst *G722dec_inst, - int16_t *encoded, + const uint8_t *encoded, int16_t len, int16_t *decoded, int16_t *speechType) @@ -94,7 +94,7 @@ int16_t WebRtcG722_Decode(G722DecInst *G722dec_inst, // Decode the G.722 encoder stream *speechType=G722_WEBRTC_SPEECH; return WebRtc_g722_decode((G722DecoderState*) G722dec_inst, - decoded, (uint8_t*) encoded, len); + decoded, encoded, len); } int16_t WebRtcG722_Version(char *versionStr, short len) diff --git a/webrtc/modules/audio_coding/codecs/g722/include/g722_interface.h b/webrtc/modules/audio_coding/codecs/g722/include/g722_interface.h index 8c9571aef..d4b35678e 100644 --- a/webrtc/modules/audio_coding/codecs/g722/include/g722_interface.h +++ b/webrtc/modules/audio_coding/codecs/g722/include/g722_interface.h @@ -168,7 +168,7 @@ int16_t WebRtcG722_FreeDecoder(G722DecInst *G722dec_inst); */ int16_t WebRtcG722_Decode(G722DecInst *G722dec_inst, - int16_t *encoded, + const uint8_t* encoded, int16_t len, int16_t *decoded, int16_t *speechType); diff --git a/webrtc/modules/audio_coding/codecs/g722/test/testG722.cc b/webrtc/modules/audio_coding/codecs/g722/test/testG722.cc index 65919a121..6d0c4322e 100644 --- a/webrtc/modules/audio_coding/codecs/g722/test/testG722.cc +++ b/webrtc/modules/audio_coding/codecs/g722/test/testG722.cc @@ -124,9 +124,8 @@ int main(int argc, char* argv[]) /* G.722 encoding + decoding */ stream_len = WebRtcG722_Encode((G722EncInst *)G722enc_inst, shortdata, framelength, streamdata); - err = WebRtcG722_Decode(G722dec_inst, - reinterpret_cast(streamdata), - stream_len, decoded, speechType); + err = WebRtcG722_Decode(G722dec_inst, streamdata, stream_len, decoded, + speechType); /* Stop clock after call to encoder and decoder */ runtime += (double)((clock()/(double)CLOCKS_PER_SEC_G722)-starttime); diff --git a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc index b8c5976d1..9ea242995 100644 --- a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc +++ b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc @@ -140,10 +140,9 @@ AudioDecoderG722::~AudioDecoderG722() { int AudioDecoderG722::Decode(const uint8_t* encoded, size_t encoded_len, int16_t* decoded, SpeechType* speech_type) { int16_t temp_type = 1; // Default is speech. - int16_t ret = WebRtcG722_Decode( - dec_state_, - const_cast(reinterpret_cast(encoded)), - static_cast(encoded_len), decoded, &temp_type); + int16_t ret = + WebRtcG722_Decode(dec_state_, encoded, static_cast(encoded_len), + decoded, &temp_type); *speech_type = ConvertSpeechType(temp_type); return ret; } @@ -176,16 +175,15 @@ int AudioDecoderG722Stereo::Decode(const uint8_t* encoded, size_t encoded_len, uint8_t* encoded_deinterleaved = new uint8_t[encoded_len]; SplitStereoPacket(encoded, encoded_len, encoded_deinterleaved); // Decode left and right. - int16_t ret = WebRtcG722_Decode( - dec_state_left_, - reinterpret_cast(encoded_deinterleaved), - static_cast(encoded_len / 2), decoded, &temp_type); + int16_t ret = WebRtcG722_Decode(dec_state_left_, encoded_deinterleaved, + static_cast(encoded_len / 2), + decoded, &temp_type); if (ret >= 0) { int decoded_len = ret; - ret = WebRtcG722_Decode( - dec_state_right_, - reinterpret_cast(&encoded_deinterleaved[encoded_len / 2]), - static_cast(encoded_len / 2), &decoded[decoded_len], &temp_type); + ret = WebRtcG722_Decode(dec_state_right_, + &encoded_deinterleaved[encoded_len / 2], + static_cast(encoded_len / 2), + &decoded[decoded_len], &temp_type); if (ret == decoded_len) { decoded_len += ret; // Interleave output.