diff options
Diffstat (limited to 'chromium/third_party/webrtc/modules/audio_coding/neteq/packet_buffer.cc')
-rw-r--r-- | chromium/third_party/webrtc/modules/audio_coding/neteq/packet_buffer.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/chromium/third_party/webrtc/modules/audio_coding/neteq/packet_buffer.cc b/chromium/third_party/webrtc/modules/audio_coding/neteq/packet_buffer.cc index 5792b227ef8..c89de12318b 100644 --- a/chromium/third_party/webrtc/modules/audio_coding/neteq/packet_buffer.cc +++ b/chromium/third_party/webrtc/modules/audio_coding/neteq/packet_buffer.cc @@ -16,6 +16,7 @@ #include <algorithm> // find_if() +#include "webrtc/base/logging.h" #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" #include "webrtc/modules/audio_coding/neteq/decoder_database.h" @@ -58,6 +59,7 @@ int PacketBuffer::InsertPacket(Packet* packet) { if (packet) { delete packet; } + LOG(LS_WARNING) << "InsertPacket invalid packet"; return kInvalidPacket; } @@ -66,6 +68,7 @@ int PacketBuffer::InsertPacket(Packet* packet) { if (buffer_.size() >= max_number_of_packets_) { // Buffer is full. Flush it. Flush(); + LOG(LS_WARNING) << "Packet buffer flushed"; return_val = kFlushed; } @@ -178,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; @@ -191,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) { @@ -237,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 = @@ -255,7 +258,7 @@ int PacketBuffer::NumSamplesInBuffer(DecoderDatabase* decoder_database, continue; } int duration = - decoder->PacketDuration(packet->payload, packet->payload_length); + decoder->PacketDuration(packet->payload, packet->payload_length); if (duration >= 0) { last_duration = duration; // Save the most up-to-date (valid) duration. } |