diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-07-01 07:41:02 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-07-01 07:41:02 +0000 |
| commit | f0c8a7e6b9b2dbf63b6c5e6e8ca684802467ef12 (patch) | |
| tree | baf756afcc317cc40792e9bae1e12545d67a1bb1 /libpcsxcore/cdriso.c | |
| parent | a49d586c751570f17160c913c94966f8a6f431b1 (diff) | |
quick cdda fix
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@53981 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/cdriso.c')
| -rw-r--r-- | libpcsxcore/cdriso.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 9eff2141..bdd21554 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -300,6 +300,7 @@ static int parsetoc(const char *isofile) { } memset(&ti, 0, sizeof(ti)); + cddaBigEndian = TRUE; // cdrdao uses big-endian for CD Audio // parse the .toc file while (fgets(linebuf, sizeof(linebuf), fi) != NULL) { @@ -329,8 +330,17 @@ static int parsetoc(const char *isofile) { } } else if (!strcmp(token, "DATAFILE")) { - sscanf(linebuf, "DATAFILE \"%[^\"]\" %8s", name, time); - tok2msf((char *)&time, (char *)&ti[numtracks].length); + if (ti[numtracks].type == CDDA) { + sscanf(linebuf, "DATAFILE \"%[^\"]\" #%d %8s", name, &t, time2); + t /= CD_FRAMESIZE_RAW + (subChanInterleaved ? SUB_FRAMESIZE : 0); + t += 2 * 75; + sec2msf(t, (char *)&ti[numtracks].start); + tok2msf((char *)&time2, (char *)&ti[numtracks].length); + } + else { + sscanf(linebuf, "DATAFILE \"%[^\"]\" %8s", name, time); + tok2msf((char *)&time, (char *)&ti[numtracks].length); + } } else if (!strcmp(token, "FILE")) { sscanf(linebuf, "FILE \"%[^\"]\" #%d %8s %8s", name, &t, time, time2); @@ -626,6 +636,17 @@ static long CALLBACK ISOshutdown(void) { return 0; } +static void PrintTracks(void) { + int i; + + for (i = 1; i <= numtracks; i++) { + SysPrintf(_("Track %.2d (%s) - Start %.2d:%.2d:%.2d, Length %.2d:%.2d:%.2d\n"), + i, (ti[i].type == DATA ? "DATA" : "AUDIO"), + ti[i].start[0], ti[i].start[1], ti[i].start[2], + ti[i].length[0], ti[i].length[1], ti[i].length[2]); + } +} + // This function is invoked by the front-end when opening an ISO // file for playback static long CALLBACK ISOopen(void) { @@ -644,7 +665,6 @@ static long CALLBACK ISOopen(void) { subChanInterleaved = FALSE; if (parsetoc(GetIsoFile()) == 0) { - cddaBigEndian = TRUE; // cdrdao uses big-endian for CD Audio SysPrintf("[+toc]"); } else if (parsecue(GetIsoFile()) == 0) { @@ -663,6 +683,8 @@ static long CALLBACK ISOopen(void) { SysPrintf(".\n"); + PrintTracks(); + return 0; } |
