X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=1233ba3f23997acbd831a26b563a7c01d97b681d;hb=d8b5433f3b09914ebb30f49bc48189d35d5a5a58;hp=232a979fe2409e86296684304e827e6742f5f2eb;hpb=78bb116f38e967174ce6255a51c9d19805e8fcb2;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 232a979f..1233ba3f 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -36,7 +36,7 @@ #include #include #define strcasecmp _stricmp -#elif HAVE_PTHREAD +#elif P_HAVE_PTHREAD #include #include #include @@ -45,7 +45,7 @@ // to enable the USE_READ_THREAD code, fix: // - https://github.com/notaz/pcsx_rearmed/issues/257 // - ISOgetBufferSub to not race with async code -#define USE_READ_THREAD 0 //HAVE_PTHREAD +#define USE_READ_THREAD 0 //P_HAVE_PTHREAD #ifdef USE_LIBRETRO_VFS #include @@ -1585,7 +1585,6 @@ static long CALLBACK ISOopen(void) { char alt_bin_filename[MAXPATHLEN]; const char *bin_filename; char image_str[1024]; - int is_chd = 0; if (cdHandle != NULL) { return 0; // it's already open @@ -1640,7 +1639,6 @@ static long CALLBACK ISOopen(void) { CDR_getBuffer = ISOgetBuffer_chd; cdimg_read_func = cdread_chd; cdimg_read_sub_func = cdread_sub_chd; - is_chd = 1; } #endif @@ -1681,14 +1679,11 @@ static long CALLBACK ISOopen(void) { } // guess whether it is mode1/2048 - if (ftello(cdHandle) % 2048 == 0) { + if (cdimg_read_func == cdread_normal && ftello(cdHandle) % 2048 == 0) { unsigned int modeTest = 0; fseek(cdHandle, 0, SEEK_SET); if (!fread(&modeTest, sizeof(modeTest), 1, cdHandle)) { -#ifndef NDEBUG SysPrintf(_("File IO error in <%s:%s>.\n"), __FILE__, __func__); -#endif - return -1; } if (SWAP32(modeTest) != 0xffffff00) { strcat(image_str, "[2048]"); @@ -1701,7 +1696,7 @@ static long CALLBACK ISOopen(void) { PrintTracks(); - if (subChanMixed && !is_chd) { + if (subChanMixed && cdimg_read_func == cdread_normal) { cdimg_read_func = cdread_sub_mixed; cdimg_read_sub_func = cdread_sub_sub_mixed; }