Fixed track detection on MacOS X 10.1
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40772
This commit is contained in:
parent
da699f5e65
commit
5cce205c2f
1 changed files with 9 additions and 5 deletions
|
@ -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') {
|
||||
trackID = 10 * trackID +(nameStr.unicode[i] - '0');
|
||||
i++;
|
||||
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;
|
||||
}
|
||||
|
||||
#if DEBUG_CDROM
|
||||
printf("Found AIFF for track %d: '%s'\n", trackID,
|
||||
CFStringGetCStringPtr (name, CFStringGetSystemEncoding()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue