Commit 5cce205c authored by Sam Lantinga's avatar Sam Lantinga

Fixed track detection on MacOS X 10.1

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40772
parent da699f5e
...@@ -370,15 +370,19 @@ int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks) ...@@ -370,15 +370,19 @@ int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks)
name = CFStringCreateWithCharacters (NULL, nameStr.unicode, nameStr.length); name = CFStringCreateWithCharacters (NULL, nameStr.unicode, nameStr.length);
// Look for .aiff extension // 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 // Extract the track id from the filename
int trackID = 0, i = 0; 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'); trackID = 10 * trackID +(nameStr.unicode[i] - '0');
i++; ++i;
} }
#if DEBUG_CDROM #if DEBUG_CDROM
printf("Found AIFF for track %d: '%s'\n", trackID, printf("Found AIFF for track %d: '%s'\n", trackID,
CFStringGetCStringPtr (name, CFStringGetSystemEncoding())); CFStringGetCStringPtr (name, CFStringGetSystemEncoding()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment