1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 17:42:17 +00:00

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.
This commit is contained in:
Stefano Pigozzi 2012-09-13 12:17:02 +02:00
parent f5de0aac96
commit 5931e53dcc

View File

@ -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