diff --git a/ChangeLog b/ChangeLog index 4effa3a2..fc269325 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +September 4, 2009 Wei Mingzhi + + * libpcsxcore/cdriso.c: Don't delay before feeding CDDA data to the SPU + plugin. + * plugins/dfsound/alsa.c: Don't try initializing CDDA sound handle over + and over and over again if failed. + September 3, 2009 Wei Mingzhi * libpcsxcore/cdriso.c: Fixed time overflow on 32-bit GNU/Linux system. 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);