Reputation: 16662
Using IOCTL_CDROM_READ_TOC_EX
, a naive way to compute the exact length of a CD-ROM track would be to assume that audio tracks have a pre-gap of 2 seconds and a data track followed by a different track type has a post-gap of 2 seconds.
But unfortunately, this is not always the case, e.g. multi-session discs.
So I came up with the following to compute the exact length for each track:
READ CD
command to read Q sub-channelINDEX
for current TNO
is zero, we're effectively in a pre|post-gap zoneThis works as expected and we can spot gaps to compute the exact track length in sectors.
However it's a bit surprising this topic isn't explained in SCSI Multimedia Commands specifications!
Question:
Is this the right approach to compute the exact length of each tracks in a CD-ROM ?
Upvotes: 3
Views: 172