Chromium Code Reviews| 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 c5b23dce068c3df75b816579b2964500fd828b7d..eeb1d272b990d987ea3cf541024990024d5dce0c 100644 |
| --- a/webrtc/modules/audio_coding/neteq/packet_buffer.cc |
| +++ b/webrtc/modules/audio_coding/neteq/packet_buffer.cc |
| @@ -76,6 +76,9 @@ int PacketBuffer::InsertPacket(Packet* packet) { |
| return kInvalidPacket; |
| } |
| + RTC_DCHECK_GE(packet->priority.codec_level, 0); |
| + RTC_DCHECK_GE(packet->priority.red_level, 0); |
|
kwiberg-webrtc
2016/09/20 14:56:23
...or maybe make the invariant-checking function p
ossu
2016/09/20 15:45:21
Acknowledged.
ossu
2016/09/21 10:23:13
Considered it but decided to keep the check like t
kwiberg-webrtc
2016/09/21 10:59:13
Acknowledged.
|
| + |
| int return_val = kOK; |
| packet->waiting_time = tick_timer_->GetNewStopwatch(); |
| @@ -262,7 +265,7 @@ int PacketBuffer::DiscardAllOldPackets(uint32_t timestamp_limit) { |
| void PacketBuffer::DiscardPacketsWithPayloadType(uint8_t payload_type) { |
| for (auto it = buffer_.begin(); it != buffer_.end(); /* */) { |
| - Packet *packet = *it; |
| + Packet* packet = *it; |
| if (packet->header.payloadType == payload_type) { |
| delete packet; |
| it = buffer_.erase(it); |
| @@ -281,7 +284,9 @@ size_t PacketBuffer::NumSamplesInBuffer(size_t last_decoded_length) const { |
| size_t last_duration = last_decoded_length; |
| for (Packet* packet : buffer_) { |
| if (packet->frame) { |
| - if (!packet->primary) { |
| + // TODO(hlundin): Verify that it's fine to count all packets and remove |
| + // this check. |
| + if (packet->priority != Packet::Priority(0, 0)) { |
| continue; |
| } |
| size_t duration = packet->frame->Duration(); |