git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@28956 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
parent
63a0075d25
commit
3b772c08b6
|
@ -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>
|
September 3, 2009 Wei Mingzhi <weimingzhi@gmail.com>
|
||||||
|
|
||||||
* libpcsxcore/cdriso.c: Fixed time overflow on 32-bit GNU/Linux system.
|
* libpcsxcore/cdriso.c: Fixed time overflow on 32-bit GNU/Linux system.
|
||||||
|
|
|
@ -46,8 +46,6 @@ static unsigned char subbuffer[SUB_FRAMESIZE];
|
||||||
|
|
||||||
static unsigned char sndbuffer[CD_FRAMESIZE_RAW * 10];
|
static unsigned char sndbuffer[CD_FRAMESIZE_RAW * 10];
|
||||||
|
|
||||||
#define CDDA_FRAMETIME (1000 * (sizeof(sndbuffer) / CD_FRAMESIZE_RAW) / 75)
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static HANDLE threadid;
|
static HANDLE threadid;
|
||||||
#else
|
#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
|
// this thread plays audio data
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static void playthread(void *param)
|
static void playthread(void *param)
|
||||||
|
@ -141,25 +124,15 @@ static void playthread(void *param)
|
||||||
static void *playthread(void *param)
|
static void *playthread(void *param)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
long t = GetTickCount();
|
|
||||||
long d;
|
long d;
|
||||||
|
|
||||||
while (playing) {
|
while (playing) {
|
||||||
d = t - (long)GetTickCount();
|
|
||||||
if (d <= 0) {
|
|
||||||
d = 1;
|
|
||||||
}
|
|
||||||
else if (d > CDDA_FRAMETIME) {
|
|
||||||
d = CDDA_FRAMETIME;
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
Sleep(d);
|
Sleep(1);
|
||||||
#else
|
#else
|
||||||
usleep(d * 1000);
|
usleep(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
t = GetTickCount() + CDDA_FRAMETIME;
|
|
||||||
|
|
||||||
if ((d = fread(sndbuffer, 1, sizeof(sndbuffer), cddaHandle)) == 0) {
|
if ((d = fread(sndbuffer, 1, sizeof(sndbuffer), cddaHandle)) == 0) {
|
||||||
playing = 0;
|
playing = 0;
|
||||||
fclose(cddaHandle);
|
fclose(cddaHandle);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user