Mercurial > sdl-ios-xcode
diff src/cdrom/macosx/CDPlayer.c @ 4190:386181851388 SDL-1.2
Fixed CD-ROM code to work with Mac OS X 10.6 SDK and 64-bit targets.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sat, 12 Sep 2009 15:06:16 +0000 |
parents | a1b03ba2fcd0 |
children |
line wrap: on
line diff
--- a/src/cdrom/macosx/CDPlayer.c Sat Sep 12 15:04:32 2009 +0000 +++ b/src/cdrom/macosx/CDPlayer.c Sat Sep 12 15:06:16 2009 +0000 @@ -134,28 +134,37 @@ { HFSUniStr255 dataForkName; OSStatus theErr; - SInt16 forkRefNum; + FSIORefNum forkRefNum; SInt64 forkSize; Ptr forkData = 0; ByteCount actualRead; CFDataRef dataRef = 0; CFPropertyListRef propertyListRef = 0; - + int i; FSRefParam fsRefPB; FSRef tocPlistFSRef; - + FSRef rootRef; const char* error = "Unspecified Error"; - + const UniChar uniName[] = { '.','T','O','C','.','p','l','i','s','t' }; + + theErr = FSGetVolumeInfo(theVolume, 0, 0, kFSVolInfoNone, 0, 0, &rootRef); + if(theErr != noErr) { + error = "FSGetVolumeInfo"; + goto bail; + } + + SDL_memset(&fsRefPB, '\0', sizeof (fsRefPB)); + /* get stuff from .TOC.plist */ - fsRefPB.ioCompletion = NULL; - fsRefPB.ioNamePtr = "\p.TOC.plist"; - fsRefPB.ioVRefNum = theVolume; - fsRefPB.ioDirID = 0; + fsRefPB.ref = &rootRef; fsRefPB.newRef = &tocPlistFSRef; - - theErr = PBMakeFSRefSync (&fsRefPB); + fsRefPB.nameLength = sizeof (uniName) / sizeof (uniName[0]); + fsRefPB.name = uniName; + fsRefPB.textEncodingHint = kTextEncodingUnknown; + + theErr = PBMakeFSRefUnicodeSync (&fsRefPB); if(theErr != noErr) { - error = "PBMakeFSRefSync"; + error = "PBMakeFSRefUnicodeSync"; goto bail; } @@ -551,9 +560,9 @@ { /*try {*/ ComponentDescription desc; - desc.componentType = kAudioUnitComponentType; - desc.componentSubType = kAudioUnitSubType_Output; - desc.componentManufacturer = kAudioUnitID_DefaultOutput; + desc.componentType = kAudioUnitType_Output; + desc.componentSubType = kAudioUnitSubType_DefaultOutput; + desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0;