diff options
Diffstat (limited to 'libpcsxcore')
| -rw-r--r-- | libpcsxcore/cdriso.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index eb7bbe3b..a65c697a 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -46,8 +46,6 @@ static unsigned char subbuffer[SUB_FRAMESIZE]; static unsigned char sndbuffer[CD_FRAMESIZE_RAW * 10]; -#define CDDA_FRAMETIME (1000 * (sizeof(sndbuffer) / CD_FRAMESIZE_RAW) / 75) - #ifdef _WIN32 static HANDLE threadid; #else @@ -119,21 +117,6 @@ static void tok2msf(char *time, char *msf) { } } -#ifndef _WIN32 -static long GetTickCount(void) { - static time_t initial_time = 0; - struct timeval now; - - gettimeofday(&now, NULL); - - if (initial_time == 0) { - initial_time = now.tv_sec; - } - - return (now.tv_sec - initial_time) * 1000L + now.tv_usec / 1000L; -} -#endif - // this thread plays audio data #ifdef _WIN32 static void playthread(void *param) @@ -141,25 +124,15 @@ static void playthread(void *param) static void *playthread(void *param) #endif { - long t = GetTickCount(); long d; while (playing) { - d = t - (long)GetTickCount(); - if (d <= 0) { - d = 1; - } - else if (d > CDDA_FRAMETIME) { - d = CDDA_FRAMETIME; - } #ifdef _WIN32 - Sleep(d); + Sleep(1); #else - usleep(d * 1000); + usleep(1); #endif - t = GetTickCount() + CDDA_FRAMETIME; - if ((d = fread(sndbuffer, 1, sizeof(sndbuffer), cddaHandle)) == 0) { playing = 0; fclose(cddaHandle); |
