aybe
aybe

Reputation: 16662

How do you detect pre/post-gap to compute exact track length in a CD-ROM?

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:

This 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

Answers (0)

Related Questions