Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3276 from jmarshallnz/time_warp

Use round() rather than MathUtils::round_int() for time, and modulate to UINT
  • Loading branch information...
commit 36bb1f4a4a25e04cc8c0cdbbf426ccf7424ed91d 2 parents 95a165e + 01f337a
@jmarshallnz jmarshallnz authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 xbmc/utils/TimeSmoother.cpp
View
6 xbmc/utils/TimeSmoother.cpp
@@ -83,8 +83,12 @@ unsigned int CTimeSmoother::GetNextFrameTime(unsigned int currentTime)
// ensure we jump at least 1 period ahead of the last time we were called
if (frameTime < m_lastFrameTime + m_period)
frameTime = m_lastFrameTime + m_period;
+ // Return an unsigned int in ms, so wrap into that, and round.
+ // Don't use MathUtils::round_int as that's restricted to -2^30..2^30
+ if (frameTime >= UINT_MAX)
+ frameTime = fmod(frameTime, UINT_MAX);
m_lastFrameTime = frameTime;
- return MathUtils::round_int(frameTime);
+ return (unsigned int)floor(frameTime + 0.5);
}
return currentTime;
}
Please sign in to comment.
Something went wrong with that request. Please try again.