From bddc41ec4023bc57b09fe4293a36adb4a1f5c8c1 Mon Sep 17 00:00:00 2001 From: ulion Date: Tue, 23 Oct 2007 00:06:08 +0000 Subject: 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 --- osdep/timer-darwin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'osdep/timer-darwin.c') diff --git a/osdep/timer-darwin.c b/osdep/timer-darwin.c index c0fd20c041..9c5a2d6893 100644 --- a/osdep/timer-darwin.c +++ b/osdep/timer-darwin.c @@ -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 */ -- cgit v1.2.3