X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=6f595792de2889b2a6ad9611d58ea81ecf262eb6;hb=ff787a954fe4b7b2d50d0dddd1437eda75df0421;hp=dca64fadfc7d8e70c1f4b0973a43f5f8595601c8;hpb=3de7d67356c1db36689ae53156944426d77f418f;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index dca64fad..6f595792 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -25,19 +25,20 @@ #include "cdriso.h" #include "ppf.h" +#include +#include + #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #include #define strcasecmp _stricmp -#define usleep(x) Sleep((x) / 1000) +#define usleep(x) (Sleep((x) / 1000)) #else #include #include #include #endif -#include -#include #define OFF_T_MSB ((off_t)1 << (sizeof(off_t) * 8 - 1)) @@ -225,7 +226,9 @@ static void *playthread(void *param) do { ret = SPU_playCDDAchannel((short *)sndbuffer, s); if (ret == 0x7761) + { usleep(6 * 1000); + } } while (ret == 0x7761 && playing); // rearmed_wait } @@ -236,7 +239,9 @@ static void *playthread(void *param) // HACK: stop feeding data while emu is paused extern int stop; while (stop && playing) + { usleep(10000); + } now = GetTickCount(); osleep = t - now; @@ -560,20 +565,15 @@ static int parsecue(const char *isofile) { if (t != 1) sscanf(linebuf, " FILE %255s", tmpb); - // absolute path? - ti[numtracks + 1].handle = fopen(tmpb, "rb"); - if (ti[numtracks + 1].handle == NULL) { - // relative to .cue? - tmp = strrchr(tmpb, '\\'); - if (tmp == NULL) - tmp = strrchr(tmpb, '/'); - if (tmp != NULL) - tmp++; - else - tmp = tmpb; - strncpy(incue_fname, tmp, incue_max_len); - ti[numtracks + 1].handle = fopen(filepath, "rb"); - } + tmp = strrchr(tmpb, '\\'); + if (tmp == NULL) + tmp = strrchr(tmpb, '/'); + if (tmp != NULL) + tmp++; + else + tmp = tmpb; + strncpy(incue_fname, tmp, incue_max_len); + ti[numtracks + 1].handle = fopen(filepath, "rb"); // update global offset if this is not first file in this .cue if (numtracks + 1 > 1) {