From 0aa3ee661c11eda7babdd92fd8a3f25c8d7a1fd0 Mon Sep 17 00:00:00 2001 From: "minyue@webrtc.org" Date: Wed, 28 May 2014 07:48:01 +0000 Subject: [PATCH] Better buffer size estimation in NetEq for redundant packets TEST=passed_all_trybots R=henrik.lundin@webrtc.org Review URL: https://webrtc-codereview.appspot.com/15579005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6260 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/audio_coding/neteq4/packet_buffer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webrtc/modules/audio_coding/neteq4/packet_buffer.cc b/webrtc/modules/audio_coding/neteq4/packet_buffer.cc index bcd0e7b4bd..da3bdf14b5 100644 --- a/webrtc/modules/audio_coding/neteq4/packet_buffer.cc +++ b/webrtc/modules/audio_coding/neteq4/packet_buffer.cc @@ -217,11 +217,11 @@ int PacketBuffer::NumSamplesInBuffer(DecoderDatabase* decoder_database, int duration; if (packet->sync_packet) { duration = last_duration; + } else if (packet->primary) { + duration = + decoder->PacketDuration(packet->payload, packet->payload_length); } else { - duration = packet->primary ? - decoder->PacketDuration(packet->payload, packet->payload_length) : - decoder->PacketDurationRedundant(packet->payload, - packet->payload_length); + continue; } if (duration >= 0) { last_duration = duration; // Save the most up-to-date (valid) duration.