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

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

Issue 1172163004: Reformat existing code. There should be no functional effects. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 6 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 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.
}

Powered by Google App Engine
This is Rietveld 408576698