Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Unified Diff: webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h

Issue 1228793004: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Compile fix Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h
diff --git a/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h b/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h
index d2b20e3b941c932cf736489b17cf4455154a9d32..a6aba3f720e8b9d8a4d8fbaf51f5144078c1c438 100644
--- a/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h
+++ b/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h
@@ -119,15 +119,16 @@ size_t AudioEncoderDecoderIsacT<T>::MaxEncodedBytes() const {
}
template <typename T>
-int AudioEncoderDecoderIsacT<T>::Num10MsFramesInNextPacket() const {
+size_t AudioEncoderDecoderIsacT<T>::Num10MsFramesInNextPacket() const {
CriticalSectionScoped cs(state_lock_.get());
const int samples_in_next_packet = T::GetNewFrameLen(isac_state_);
- return rtc::CheckedDivExact(samples_in_next_packet,
- rtc::CheckedDivExact(SampleRateHz(), 100));
+ return static_cast<size_t>(
+ rtc::CheckedDivExact(samples_in_next_packet,
+ rtc::CheckedDivExact(SampleRateHz(), 100)));
}
template <typename T>
-int AudioEncoderDecoderIsacT<T>::Max10MsFramesInAPacket() const {
+size_t AudioEncoderDecoderIsacT<T>::Max10MsFramesInAPacket() const {
return 6; // iSAC puts at most 60 ms in a packet.
}
@@ -192,8 +193,7 @@ int AudioEncoderDecoderIsacT<T>::DecodeInternal(const uint8_t* encoded,
}
int16_t temp_type = 1; // Default is speech.
int ret =
- T::DecodeInternal(isac_state_, encoded, static_cast<int16_t>(encoded_len),
- decoded, &temp_type);
+ T::DecodeInternal(isac_state_, encoded, encoded_len, decoded, &temp_type);
*speech_type = ConvertSpeechType(temp_type);
return ret;
}
@@ -204,7 +204,8 @@ bool AudioEncoderDecoderIsacT<T>::HasDecodePlc() const {
}
template <typename T>
-int AudioEncoderDecoderIsacT<T>::DecodePlc(int num_frames, int16_t* decoded) {
+size_t AudioEncoderDecoderIsacT<T>::DecodePlc(size_t num_frames,
+ int16_t* decoded) {
CriticalSectionScoped cs(state_lock_.get());
return T::DecodePlc(isac_state_, decoded, num_frames);
}
@@ -223,7 +224,7 @@ int AudioEncoderDecoderIsacT<T>::IncomingPacket(const uint8_t* payload,
uint32_t arrival_timestamp) {
CriticalSectionScoped cs(state_lock_.get());
return T::UpdateBwEstimate(
- isac_state_, payload, static_cast<int32_t>(payload_len),
+ isac_state_, payload, payload_len,
rtp_sequence_number, rtp_timestamp, arrival_timestamp);
}

Powered by Google App Engine
This is Rietveld 408576698