Skip to content
Permalink
Browse files

Fixed track detection on MacOS X 10.1

  • Loading branch information
slouken committed Jan 4, 2004
1 parent b711155 commit 6db1f10302888532ff2190bc0696b3d1cd1a72ea
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/cdrom/macosx/CDPlayer.cpp
@@ -370,15 +370,19 @@ int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks)
name = CFStringCreateWithCharacters (NULL, nameStr.unicode, nameStr.length);

// Look for .aiff extension
if (CFStringHasSuffix (name, CFSTR(".aiff"))) {
if (CFStringHasSuffix (name, CFSTR(".aiff")) ||
CFStringHasSuffix (name, CFSTR(".cdda"))) {

// Extract the track id from the filename
int trackID = 0, i = 0;
while (nameStr.unicode[i] >= '0' && nameStr.unicode[i] <= '9') {
while (i < nameStr.length && !isdigit(nameStr.unicode[i])) {
++i;
}
while (i < nameStr.length && isdigit(nameStr.unicode[i])) {
trackID = 10 * trackID +(nameStr.unicode[i] - '0');
i++;
++i;
}

#if DEBUG_CDROM
printf("Found AIFF for track %d: '%s'\n", trackID,
CFStringGetCStringPtr (name, CFStringGetSystemEncoding()));

0 comments on commit 6db1f10

Please sign in to comment.