src/cdrom/macosx/CDPlayer.cpp
changeset 771 336603031bab
parent 768 de1b2c3063b9
child 775 08b7fc2b5225
equal deleted inserted replaced
770:ac44ddb84f6f 771:336603031bab
   368                 
   368                 
   369                 CFStringRef  name;
   369                 CFStringRef  name;
   370                 name = CFStringCreateWithCharacters (NULL, nameStr.unicode, nameStr.length);
   370                 name = CFStringCreateWithCharacters (NULL, nameStr.unicode, nameStr.length);
   371                 
   371                 
   372                 // Look for .aiff extension
   372                 // Look for .aiff extension
   373                 if (CFStringHasSuffix (name, CFSTR(".aiff"))) {
   373                 if (CFStringHasSuffix (name, CFSTR(".aiff")) ||
       
   374                     CFStringHasSuffix (name, CFSTR(".cdda"))) {
   374                     
   375                     
   375                     // Extract the track id from the filename
   376                     // Extract the track id from the filename
   376                     int trackID = 0, i = 0;
   377                     int trackID = 0, i = 0;
   377                     while (nameStr.unicode[i] >= '0' && nameStr.unicode[i] <= '9') {
   378                     while (i < nameStr.length && !isdigit(nameStr.unicode[i])) {
       
   379                         ++i;
       
   380                     }
       
   381                     while (i < nameStr.length && isdigit(nameStr.unicode[i])) {
   378                         trackID = 10 * trackID +(nameStr.unicode[i] - '0');
   382                         trackID = 10 * trackID +(nameStr.unicode[i] - '0');
   379                         i++;
   383                         ++i;
   380                     }
   384                     }
   381                     
   385 
   382                     #if DEBUG_CDROM
   386                     #if DEBUG_CDROM
   383                     printf("Found AIFF for track %d: '%s'\n", trackID, 
   387                     printf("Found AIFF for track %d: '%s'\n", trackID, 
   384                     CFStringGetCStringPtr (name, CFStringGetSystemEncoding()));
   388                     CFStringGetCStringPtr (name, CFStringGetSystemEncoding()));
   385                     #endif
   389                     #endif
   386                     
   390