cdriso: fill trackinfo for metadata-less formats
authornotaz <notasas@gmail.com>
Fri, 15 Aug 2025 17:51:44 +0000 (20:51 +0300)
committernotaz <notasas@gmail.com>
Fri, 15 Aug 2025 18:17:46 +0000 (21:17 +0300)
libretro/pcsx_rearmed#894

libpcsxcore/cdriso.c

index 4c4bff6..a917b54 100644 (file)
@@ -1494,6 +1494,14 @@ int ISOopen(const char *fname)
                        isMode1ISO = TRUE;
                }
        }
+       if (cdHandle && numtracks == 0) {
+               // assume some metadata-less format
+               numtracks = 1;
+               ti[1].type = DATA;
+               ti[1].start_offset = 0;
+               sec2msf(2 * 75, ti[1].start);
+               sec2msf(isMode1ISO ? size_main / 2048u : size_main / 2352u, ti[1].length);
+       }
 
        SysPrintf("%s (%lld bytes).\n", image_str, (long long)size_main);