From 05df1bf907ace40cc43e72249af8decc6d71e6f4 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Thu, 3 Sep 2009 15:52:51 +0000 Subject: git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@28791 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- libpcsxcore/cdriso.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libpcsxcore') diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index d1869734..c7485b6a 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -119,9 +119,16 @@ static void tok2msf(char *time, char *msf) { #ifndef _WIN32 static long GetTickCount(void) { - struct timeval now; + static time_t initial_time = 0; + struct timeval now; + gettimeofday(&now, NULL); - return now.tv_sec * 1000L + now.tv_usec / 1000L; + + if (initial_time == 0) { + initial_time = now.tv_sec; + } + + return (now.tv_sec - initial_time) * 1000L + now.tv_usec / 1000L; } #endif @@ -135,14 +142,13 @@ static void *playthread(void *param) time_t t; long d; - t = 0; + t = GetTickCount(); while (playing) { d = (long)t - GetTickCount(); if (d <= 0) { d = 1; } - #ifdef _WIN32 Sleep(d); #else -- cgit v1.2.3