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 08b237f8463bc881f6db3b95bef62ced32a1c3db..5792b227ef84aeb7e51aa9d1c125cf407a7ffe15 100644 |
--- a/webrtc/modules/audio_coding/neteq/packet_buffer.cc |
+++ b/webrtc/modules/audio_coding/neteq/packet_buffer.cc |
@@ -250,16 +250,12 @@ int PacketBuffer::NumSamplesInBuffer(DecoderDatabase* decoder_database, |
Packet* packet = (*it); |
AudioDecoder* decoder = |
decoder_database->GetDecoder(packet->header.payloadType); |
- if (decoder) { |
- int duration; |
- if (packet->sync_packet) { |
- duration = last_duration; |
- } else if (packet->primary) { |
- duration = |
- decoder->PacketDuration(packet->payload, packet->payload_length); |
- } else { |
+ if (decoder && !packet->sync_packet) { |
+ if (!packet->primary) { |
continue; |
} |
+ int duration = |
+ decoder->PacketDuration(packet->payload, packet->payload_length); |
if (duration >= 0) { |
last_duration = duration; // Save the most up-to-date (valid) duration. |
} |