Mercurial > mplayer.hg
changeset 24815:c10db72e1afc
Fix GetTimerMS() discontinuous return value bug caused by GetTimer() overflow
on darwin. This bug will cause osd stuck on darwin.
author | ulion |
---|---|
date | Tue, 23 Oct 2007 00:06:08 +0000 |
parents | 1903b15e6fb7 |
children | ba929c5ee0bc |
files | osdep/timer-darwin.c |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/osdep/timer-darwin.c Mon Oct 22 22:42:47 2007 +0000 +++ b/osdep/timer-darwin.c Tue Oct 23 00:06:08 2007 +0000 @@ -61,7 +61,8 @@ /* 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 */