From eefba554198b2cbc90a018943a0baef96266248a Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 30 Dec 2014 20:44:18 +0000 Subject: [PATCH] fix assert in utp_stream at high rates --- src/timestamp_history.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/timestamp_history.cpp b/src/timestamp_history.cpp index ef35f87c3..c3a64ff9b 100644 --- a/src/timestamp_history.cpp +++ b/src/timestamp_history.cpp @@ -53,7 +53,8 @@ boost::uint32_t timestamp_history::add_sample(boost::uint32_t sample, bool step) m_num_samples = 0; } - ++m_num_samples; + // don't let the counter wrap + if (m_num_samples < 0xfffe) ++m_num_samples; // if sample is less than base, update the base // and update the history entry (because it will