X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=549b62f7933a323567bf93f9044f6672193970a5;hb=9532b0f41b808d0155f8d26a4a81553a13593d58;hp=ee2342127978148ea6c76f09eb29f9ef10a207af;hpb=9361a5aa4fef73e06bc78b7c462eb28a7d12e3d0;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index ee234212..549b62f7 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -1754,7 +1754,7 @@ static long CALLBACK ISOopen(void) { if (ftello(cdHandle) % 2048 == 0) { unsigned int modeTest = 0; fseek(cdHandle, 0, SEEK_SET); - if (fread(&modeTest, sizeof(modeTest), 1, cdHandle) != sizeof(modeTest)) { + if (!fread(&modeTest, sizeof(modeTest), 1, cdHandle)) { #ifndef NDEBUG SysPrintf(_("File IO error in <%s:%s>.\n"), __FILE__, __func__); #endif @@ -1915,12 +1915,12 @@ static void DecodeRawSubData(void) { // read track // time: byte 0 - minute; byte 1 - second; byte 2 - frame // uses bcd format -static long CALLBACK ISOreadTrack(unsigned char *time) { +static boolean CALLBACK ISOreadTrack(unsigned char *time) { int sector = MSF2SECT(btoi(time[0]), btoi(time[1]), btoi(time[2])); long ret; if (cdHandle == NULL) { - return -1; + return 0; } if (pregapOffset) { @@ -1934,7 +1934,7 @@ static long CALLBACK ISOreadTrack(unsigned char *time) { ret = cdimg_read_func(cdHandle, 0, cdbuffer, sector); if (ret < 0) - return -1; + return 0; if (subHandle != NULL) { fseek(subHandle, sector * SUB_FRAMESIZE, SEEK_SET); @@ -1945,7 +1945,7 @@ static long CALLBACK ISOreadTrack(unsigned char *time) { if (subChanRaw) DecodeRawSubData(); } - return 0; + return 1; } // plays cdda audio