mirror of
https://github.com/yawut/SDL.git
synced 2026-04-19 15:17:23 -05:00
Fixed track detection on MacOS X 10.1
This commit is contained in:
parent
44c336b863
commit
a0db91cab5
|
|
@ -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…
Reference in New Issue
Block a user