summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2012-09-13 12:17:02 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2012-10-16 07:19:32 +0200
commit5931e53dcca9a2066566e939d9e4cb27383cc818 (patch)
treebcb5889ce859134910afb57b8c42748e30cdd3b4
parentf5de0aac96621b584bdb5fd1ca5916529d219b0a (diff)
downloadmpv-5931e53dcca9a2066566e939d9e4cb27383cc818.tar.bz2
mpv-5931e53dcca9a2066566e939d9e4cb27383cc818.tar.xz
cocoa_common: replace TickCount() with NSProcessInfo#systemUptime
TickCount is depracted in OS X 10.8. Substitute it with a public Cocoa API call available since OS X 10.6.
-rw-r--r--libvo/cocoa_common.m7
1 files changed, 3 insertions, 4 deletions
diff --git a/libvo/cocoa_common.m b/libvo/cocoa_common.m
index aba18140ba..20bfab5533 100644
--- a/libvo/cocoa_common.m
+++ b/libvo/cocoa_common.m
@@ -424,14 +424,13 @@ int vo_cocoa_check_events(struct vo *vo)
{
struct vo_cocoa_state *s = vo->cocoa;
NSEvent *event;
- float curTime = TickCount()/60;
- int msCurTime = (int) (curTime * 1000);
+ int ms_time = (int) ([[NSProcessInfo processInfo] systemUptime] * 1000);
// automatically hide mouse cursor
if (vo_fs && s->display_cursor &&
- (msCurTime - s->cursor_timer >= s->cursor_autohide_delay)) {
+ (ms_time - s->cursor_timer >= s->cursor_autohide_delay)) {
vo_cocoa_display_cursor(vo, 0);
- s->cursor_timer = msCurTime;
+ s->cursor_timer = ms_time;
}
event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil