mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
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:
committed by
Jacek Jendrzej
parent
3a758cade1
commit
b12f7f3320
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user