Index: webrtc/modules/video_coding/sequence_number_util.h |
diff --git a/webrtc/modules/video_coding/sequence_number_util.h b/webrtc/modules/video_coding/sequence_number_util.h |
index 008e5f1623681145f7714c4ea4cec54b09f2dfb6..05f33676d53bc583b546d3cb30e6bbc3b8b144d6 100644 |
--- a/webrtc/modules/video_coding/sequence_number_util.h |
+++ b/webrtc/modules/video_coding/sequence_number_util.h |
@@ -91,7 +91,13 @@ class SeqNumUnwrapper { |
"Type unwrapped must be an unsigned integer smaller than uint64_t."); |
public: |
- SeqNumUnwrapper() : last_unwrapped_(0) {} |
+ // We want a value that is close to 2^63 for two reasons. Firstly, we |
+ // can unwrap wrapping numbers in either direction, and secondly, we avoid |
+ // causing a crash on bad input. We also want the default value to be somewhat |
+ // human readable, a power of 10 for example. |
+ static constexpr uint64_t kDefaultStartValue = 10000000000000000000UL; |
+ |
+ SeqNumUnwrapper() : last_unwrapped_(kDefaultStartValue) {} |
explicit SeqNumUnwrapper(uint64_t start_at) : last_unwrapped_(start_at) {} |
uint64_t Unwrap(T value) { |