Reformat existing code. There should be no functional effects.

This includes changes like:
* Attempt to break lines at better positions
* Use "override" in more places, don't use "virtual" with it
* Use {} where the body is more than one line
* Make declaration and definition arg names match
* Eliminate unused code
* EXPECT_EQ(expected, actual) (but use (actual, expected) for e.g. _GT)
* Correct #include order
* Use anonymous namespaces in preference to "static" for file-scoping
* Eliminate unnecessary casts
* Update reference code in comments of ARM assembly sources to match actual current C code
* Fix indenting to be more style-guide compliant
* Use arraysize() in more places
* Use bool instead of int for "boolean" values (0/1)
* Shorten and simplify code
* Spaces around operators
* 80 column limit
* Use const more consistently
* Space goes after '*' in type name, not before
* Remove unnecessary return values
* Use "(var == const)", not "(const == var)"
* Spelling
* Prefer true, typed constants to "enum hack" constants
* Avoid "virtual" on non-overridden functions
* ASSERT(x == y) -> ASSERT_EQ(y, x)

BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kjellander@webrtc.org, kwiberg@webrtc.org

Review URL: https://codereview.webrtc.org/1172163004

Cr-Commit-Position: refs/heads/master@{#9420}
This commit is contained in:
Peter Kasting
2015-06-11 14:31:38 -07:00
parent b7e5054414
commit 728d9037c0
90 changed files with 416 additions and 490 deletions

View File

@ -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.
}