diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-09-04 13:08:17 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-09-04 13:08:17 +0000 |
| commit | 3b772c08b6a0475d407fff0fdaf1619cd8f5cc8f (patch) | |
| tree | ac486f0d1a89273c2265cb8f6ef333081a86f30d | |
| parent | 63a0075d252741b0a1d9556e66e2cc4d76705747 (diff) | |
| download | pcsxr-3b772c08b6a0475d407fff0fdaf1619cd8f5cc8f.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@28956 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | libpcsxcore/cdriso.c | 31 |
2 files changed, 9 insertions, 29 deletions
@@ -1,3 +1,10 @@ +September 4, 2009 Wei Mingzhi <weimingzhi@gmail.com> + + * 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 <weimingzhi@gmail.com> * 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); |
