Use int64_t more consistently for times, in particular for RTT values.
Existing code was inconsistent about whether to use uint16_t, int, unsigned int,
or uint32_t, and sometimes silently truncated one to another, or truncated
int64_t. Because most core time-handling functions use int64_t, being
consistent about using int64_t unless otherwise necessary minimizes the number
of explicit or implicit casts.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, holmer@google.com, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/31349004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8045 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/main/acm2/nack.h b/webrtc/modules/audio_coding/main/acm2/nack.h
index 3809327..d74bb1f 100644
--- a/webrtc/modules/audio_coding/main/acm2/nack.h
+++ b/webrtc/modules/audio_coding/main/acm2/nack.h
@@ -87,7 +87,7 @@
// Get a list of "missing" packets which have expected time-to-play larger
// than the given round-trip-time (in milliseconds).
// Note: Late packets are not included.
- std::vector<uint16_t> GetNackList(int round_trip_time_ms) const;
+ std::vector<uint16_t> GetNackList(int64_t round_trip_time_ms) const;
// Reset to default values. The NACK list is cleared.
// |nack_threshold_packets_| & |max_nack_list_size_| preserve their values.
@@ -98,7 +98,7 @@
FRIEND_TEST_ALL_PREFIXES(NackTest, EstimateTimestampAndTimeToPlay);
struct NackElement {
- NackElement(int initial_time_to_play_ms,
+ NackElement(int64_t initial_time_to_play_ms,
uint32_t initial_timestamp,
bool missing)
: time_to_play_ms(initial_time_to_play_ms),
@@ -107,7 +107,7 @@
// Estimated time (ms) left for this packet to be decoded. This estimate is
// updated every time jitter buffer decodes a packet.
- int time_to_play_ms;
+ int64_t time_to_play_ms;
// A guess about the timestamp of the missing packet, it is used for
// estimation of |time_to_play_ms|. The estimate might be slightly wrong if
@@ -171,7 +171,7 @@
uint32_t EstimateTimestamp(uint16_t sequence_number);
// Compute time-to-play given a timestamp.
- int TimeToPlay(uint32_t timestamp) const;
+ int64_t TimeToPlay(uint32_t timestamp) const;
// If packet N is arrived, any packet prior to N - |nack_threshold_packets_|
// which is not arrived is considered missing, and should be in NACK list.