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

Unified Diff: webrtc/modules/audio_coding/neteq/packet_buffer.cc

Issue 1228843002: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments 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/neteq/packet_buffer.cc
diff --git a/webrtc/modules/audio_coding/neteq/packet_buffer.cc b/webrtc/modules/audio_coding/neteq/packet_buffer.cc
index 431e0f122c55f4fb6fd97ab51dc6751dd65e4a28..c89de12318b990ed4b3df4344cac2c0ef5e5f8a4 100644
--- a/webrtc/modules/audio_coding/neteq/packet_buffer.cc
+++ b/webrtc/modules/audio_coding/neteq/packet_buffer.cc
@@ -181,7 +181,7 @@ const RTPHeader* PacketBuffer::NextRtpHeader() const {
return const_cast<const RTPHeader*>(&(buffer_.front()->header));
}
-Packet* PacketBuffer::GetNextPacket(int* discard_count) {
+Packet* PacketBuffer::GetNextPacket(size_t* discard_count) {
if (Empty()) {
// Buffer is empty.
return NULL;
@@ -194,7 +194,7 @@ Packet* PacketBuffer::GetNextPacket(int* discard_count) {
// Discard other packets with the same timestamp. These are duplicates or
// redundant payloads that should not be used.
- int discards = 0;
+ size_t discards = 0;
while (!Empty() &&
buffer_.front()->header.timestamp == packet->header.timestamp) {
@@ -240,15 +240,15 @@ int PacketBuffer::DiscardAllOldPackets(uint32_t timestamp_limit) {
return DiscardOldPackets(timestamp_limit, 0);
}
-int PacketBuffer::NumPacketsInBuffer() const {
- return static_cast<int>(buffer_.size());
+size_t PacketBuffer::NumPacketsInBuffer() const {
+ return buffer_.size();
}
-int PacketBuffer::NumSamplesInBuffer(DecoderDatabase* decoder_database,
- int last_decoded_length) const {
+size_t PacketBuffer::NumSamplesInBuffer(DecoderDatabase* decoder_database,
+ size_t last_decoded_length) const {
PacketList::const_iterator it;
- int num_samples = 0;
- int last_duration = last_decoded_length;
+ size_t num_samples = 0;
+ size_t last_duration = last_decoded_length;
for (it = buffer_.begin(); it != buffer_.end(); ++it) {
Packet* packet = (*it);
AudioDecoder* decoder =
« no previous file with comments | « webrtc/modules/audio_coding/neteq/packet_buffer.h ('k') | webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698