1
mirror of https://github.com/mpv-player/mpv synced 2024-10-22 08:51:57 +02:00

Fix GetTimerMS() discontinuous return value bug caused by GetTimer() overflow

on darwin. This bug will cause osd stuck on darwin.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24843 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ulion 2007-10-23 00:06:08 +00:00
parent 3cb11cbe20
commit bddc41ec40

View File

@ -61,7 +61,8 @@ unsigned int GetTimer()
/* current time in milliseconds */
unsigned int GetTimerMS()
{
return (unsigned int)(GetTimer() / 1000);
return (unsigned int)((mach_absolute_time() * timebase_ratio - startup_time)
* 1e3);
}
/* time spent between now and last call in seconds */