X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=169c94503f981acb62592d47997f3c02c20babcb;hb=a4344ee8b6aa01f1f0115b88067196b8b82ce821;hp=515370f756d2a0ec88d232fa9e8ea8382709dc1f;hpb=cc3768145667aef20eab35da0908755d5bd395ab;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 515370f7..169c9450 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; @@ -1089,7 +1094,7 @@ static int cdread_sub_mixed(FILE *f, unsigned int base, void *dest, int sector) return ret; } -static int uncompress2(void *out, unsigned long *out_size, void *in, unsigned long in_size) +static int uncomp2(void *out, unsigned long *out_size, void *in, unsigned long in_size) { static z_stream z; int ret = 0; @@ -1169,7 +1174,7 @@ static int cdread_compressed(FILE *f, unsigned int base, void *dest, int sector) if (is_compressed) { cdbuffer_size_expect = sizeof(compr_img->buff_raw[0]) << compr_img->block_shift; cdbuffer_size = cdbuffer_size_expect; - ret = uncompress2(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size); + ret = uncomp2(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size); if (ret != 0) { SysPrintf("uncompress failed with %d for block %d, sector %d\n", ret, block, sector);