summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-09-03 15:52:51 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-09-03 15:52:51 +0000
commit05df1bf907ace40cc43e72249af8decc6d71e6f4 (patch)
treee0c939ac9f357e1304b6d89789bc1d2205c8778e /libpcsxcore
parenta246d4bfdfe4433bc37cf041fad616dd52e97303 (diff)
downloadpcsxr-05df1bf907ace40cc43e72249af8decc6d71e6f4.tar.gz
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@28791 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/cdriso.c14
1 files changed, 10 insertions, 4 deletions
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