comparison 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
comparison
equal deleted inserted replaced
4189:95213cf5efcc 4190:386181851388
132 132
133 int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD) 133 int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD)
134 { 134 {
135 HFSUniStr255 dataForkName; 135 HFSUniStr255 dataForkName;
136 OSStatus theErr; 136 OSStatus theErr;
137 SInt16 forkRefNum; 137 FSIORefNum forkRefNum;
138 SInt64 forkSize; 138 SInt64 forkSize;
139 Ptr forkData = 0; 139 Ptr forkData = 0;
140 ByteCount actualRead; 140 ByteCount actualRead;
141 CFDataRef dataRef = 0; 141 CFDataRef dataRef = 0;
142 CFPropertyListRef propertyListRef = 0; 142 CFPropertyListRef propertyListRef = 0;
143 143 int i;
144 FSRefParam fsRefPB; 144 FSRefParam fsRefPB;
145 FSRef tocPlistFSRef; 145 FSRef tocPlistFSRef;
146 146 FSRef rootRef;
147 const char* error = "Unspecified Error"; 147 const char* error = "Unspecified Error";
148 148 const UniChar uniName[] = { '.','T','O','C','.','p','l','i','s','t' };
149
150 theErr = FSGetVolumeInfo(theVolume, 0, 0, kFSVolInfoNone, 0, 0, &rootRef);
151 if(theErr != noErr) {
152 error = "FSGetVolumeInfo";
153 goto bail;
154 }
155
156 SDL_memset(&fsRefPB, '\0', sizeof (fsRefPB));
157
149 /* get stuff from .TOC.plist */ 158 /* get stuff from .TOC.plist */
150 fsRefPB.ioCompletion = NULL; 159 fsRefPB.ref = &rootRef;
151 fsRefPB.ioNamePtr = "\p.TOC.plist";
152 fsRefPB.ioVRefNum = theVolume;
153 fsRefPB.ioDirID = 0;
154 fsRefPB.newRef = &tocPlistFSRef; 160 fsRefPB.newRef = &tocPlistFSRef;
155 161 fsRefPB.nameLength = sizeof (uniName) / sizeof (uniName[0]);
156 theErr = PBMakeFSRefSync (&fsRefPB); 162 fsRefPB.name = uniName;
163 fsRefPB.textEncodingHint = kTextEncodingUnknown;
164
165 theErr = PBMakeFSRefUnicodeSync (&fsRefPB);
157 if(theErr != noErr) { 166 if(theErr != noErr) {
158 error = "PBMakeFSRefSync"; 167 error = "PBMakeFSRefUnicodeSync";
159 goto bail; 168 goto bail;
160 } 169 }
161 170
162 /* Load and parse the TOC XML data */ 171 /* Load and parse the TOC XML data */
163 172
549 SDL_CreateThread(RunCallBackThread, NULL); 558 SDL_CreateThread(RunCallBackThread, NULL);
550 559
551 { /*try {*/ 560 { /*try {*/
552 ComponentDescription desc; 561 ComponentDescription desc;
553 562
554 desc.componentType = kAudioUnitComponentType; 563 desc.componentType = kAudioUnitType_Output;
555 desc.componentSubType = kAudioUnitSubType_Output; 564 desc.componentSubType = kAudioUnitSubType_DefaultOutput;
556 desc.componentManufacturer = kAudioUnitID_DefaultOutput; 565 desc.componentManufacturer = kAudioUnitManufacturer_Apple;
557 desc.componentFlags = 0; 566 desc.componentFlags = 0;
558 desc.componentFlagsMask = 0; 567 desc.componentFlagsMask = 0;
559 568
560 Component comp = FindNextComponent (NULL, &desc); 569 Component comp = FindNextComponent (NULL, &desc);
561 if (comp == NULL) { 570 if (comp == NULL) {