timer: fix previous commit

Sigh... of course the type of the (?:) exprsssion is double, so
INT64_MAX was converted to double, which is a problem.
This commit is contained in:
wm4 2014-05-22 22:50:39 +02:00
parent c9b68957c9
commit 2e6b0b4ee4
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ int64_t mp_add_timeout(int64_t time_us, double timeout_sec)
{
assert(time_us > 0); // mp_time_us() returns strictly positive values
double t = MPCLAMP(timeout_sec * (1000 * 1000), -0x1p63, 0x1p63);
int64_t ti = t == 0x1p63 ? INT64_MAX : t;
int64_t ti = t == 0x1p63 ? INT64_MAX : (int64_t)t;
if (ti > INT64_MAX - time_us)
return INT64_MAX;
if (ti <= -time_us)