change time_monotonic_ms() from time_t to int64_t

time_monotonic_ms values did wrap every ~24 days, leading to problems
in code that did not cope with that. Instead of fixing all places where
relative comparisons with time_monotonic_ms() are made, just use a
bigger datatype. Convert all users to the new type.


Origin commit data
------------------
Commit: 8dad062eff
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-09-23 (Sat, 23 Sep 2017)
This commit is contained in:
Stefan Seyfried
2017-09-23 21:35:01 +02:00
committed by Jacek Jendrzej
parent 3a758cade1
commit b12f7f3320
11 changed files with 40 additions and 36 deletions

View File

@@ -1035,7 +1035,7 @@ int CStreamInfo2::update_rate ()
usleep(timeout * 1000);
b_len = mp->GetReadCount();
} else {
time_t start = time_monotonic_ms();
int64_t start = time_monotonic_ms();
/* always sample for ~100ms */
while (time_monotonic_ms() - start < timeout)
{
@@ -1043,7 +1043,7 @@ int CStreamInfo2::update_rate ()
if (ret >= 0)
b_len += ret;
}
//printf("ts: read %d time %d\n", b_len, time_monotonic_ms() - start);
//printf("ts: read %d time %" PRId64 "\n", b_len, time_monotonic_ms() - start);
}
//printf("ts: read %d\n", b_len);