Tue 21 Feb 2006 03:58:37 PM UTC, comment #7:
osx.c around line 94 does have the "lead-out" track number set 162(0xA2).
It's possible that one might want to store some of the other non-track information (0xA0, 0xA1). And get_track_format_osx() might be either non-optimal or worse wrong in some cases. However as I don't have access to an OSX computer with an attached drive, it is difficult for me to do such experiments.
Instead, I welcome others who are interested to investigate and by all means send patches. The idea of open source is that everyone who is able can contribute. In fact if you want OSX support improved, this is probably the best way to ensure it gets done.
(Sorry about the verbatim unmodified quote in comment #6. My navigation/editing expertice of Tracker has a bit to be desired.)
|
Mon 20 Feb 2006 03:36:35 AM UTC, comment #6:
hi, Rocky.
The "lead-out" track number on Mac OS X is 162(0xA2).
> --DEBUG: point: 162, tno: 0, session: 1, adr: 1, control:0, address: 0:0:0, p: 48:50:11
The track number 170(0xAA) is not found in CDTOC structure of Mac OS X.
BTW, I found the following text.
>The CDTOC structure is same as what is returned by a READ TOC command, format 0x02.
URL: http://developer.apple.com/documentation/Darwin/Reference/IOKit/IOCDMedia/CompositePage.html
I think that "format 0x02" might be different from general TOC information.
|
Sat 18 Feb 2006 09:45:25 PM UTC, comment #4:
hi, Rocky.
p_env->i_descriptors come from below line in lib/driver/osx.c .
p_env->i_descriptors = CDTOCGetDescriptorCount ( p_env->pTOC );
The value that CDTOCGetDescriptorCount() returns is not the total number of tracks in Audio CD.
CDTOCGetDescriptorCount() returns the total number of tracks + 3. ( I have not seen other cases. )
Please see below debug log. This is not the worst case. In the worst case, the Segmantaiton Fault will occurs.
--DEBUG: point: 160, tno: 0, session: 1, adr: 1, control:0, address: 0:0:0, p: 1:0:0
--DEBUG: point: 161, tno: 0, session: 1, adr: 1, control:0, address: 0:0:0, p: 4:0:0
--DEBUG: point: 162, tno: 0, session: 1, adr: 1, control:0, address: 0:0:0, p: 48:50:11
--DEBUG: point: 1, tno: 0, session: 1, adr: 1, control:0, address: 0:0:0, p: 0:2:0
--DEBUG: point: 2, tno: 0, session: 1, adr: 1, control:0, address: 0:0:0, p: 7:50:42
--DEBUG: point: 3, tno: 0, session: 1, adr: 1, control:0, address: 0:0:0, p: 27:6:56
--DEBUG: point: 4, tno: 0, session: 1, adr: 1, control:0, address: 0:0:0, p: 47:9:5
--DEBUG: point: 0, tno: 0, session: 0, adr: 0, control:0, address: 0:0:0, p: 255:255:255
This Audio CD has 4 tracks, and The value that CDTOCGetDescriptorCount() returns is 7.
The last line is pTrackDescriptors[7]. this line is random per execute.
Please do not access pTrackDescriptors[p_env->i_descriptors] because the number of elements in pTrackDescriptors[] array is p_env->i_descriptors, not (p_env->i_descriptors + 1).
Sample Code is here.
http://www.opensource.apple.com/darwinsource/10.3.4/IOSCSIArchitectureModelFamily-135.3.2/TestTools/Optical/CDTOC/CDTOC.c
---
demo-n
|