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

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

Issue 2342443005: Moved Opus-specific payload splitting into AudioDecoderOpus. (Closed)
Patch Set: Some small fixes. Created 4 years, 3 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 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);
+
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();

Powered by Google App Engine
This is Rietveld 408576698