libaaruformat 1.0 Aaru Data Preservation Suite - Format Library

Loading...
Searching...
No Matches
optical.h File Reference

On-disk structures describing optical disc tracks (Track list block). More...

Go to the source code of this file.

## Data Structures
struct | TracksHeader
| Header for an optical tracks block listing track entries. More...
struct | TrackEntry
| Single optical disc track descriptor (sequence, type, LBAs, session, ISRC, flags). More...

## Typedefs
typedef struct TracksHeader | TracksHeader
typedef struct TrackEntry | TrackEntry

## Detailed Description

On-disk structures describing optical disc tracks (Track list block).

An optical tracks block (identifier == BlockType::TracksBlock) stores a list of TrackEntry records describing the logical layout of tracks and sessions for CD/DVD/BD and similar media.

Layout: TracksHeader (fixed) TrackEntry[ entries ] (array, packed)

CRC semantics:

- TracksHeader::crc64 is a CRC64-ECMA over the contiguous TrackEntry array ONLY (header excluded).
- For legacy images (imageMajorVersion <= AARUF_VERSION_V1) a byte swap is applied when verifying.

Field semantics (TrackEntry):

- sequence: Logical track number (1..99 typical for CD). Values outside that range may encode extras.
- type: Value from TrackType (Audio, Data, Mode variants, etc.).
- start / end: Inclusive Logical Block Address (LBA) bounds for the track. end >= start.
- pregap: Number of sectors of pre-gap preceding the track's first user-accessible sector (can be 0 or negative if representing lead-in semantics; negative interpretation is implementation-defined).
- session: Session number starting at 1 for multi-session discs (1 for single session).
- isrc: 13-byte ISRC (raw code, no terminating null). If fewer significant characters, remaining bytes are 0.
- flags: Bitmask of track/control flags. Unless otherwise specified, recommended mapping (mirrors CD subchannel Q control bits) is: bit0 Pre-emphasis, bit1 Copy permitted, bit2 Data track, bit3 Four-channel audio, bits4-7 reserved. Actual semantics may be extended by the format specification.

Invariants / validation recommendations:

- identifier == BlockType::TracksBlock
- entries * sizeof(TrackEntry) bytes are present after the header in the block image.
- 1 <= sequence <= 99 for standard CD tracks (non-conforming values allowed but should be documented).
- start <= end; pregap >= 0 (if negative pregaps unsupported in implementation).
- ISRC bytes either all zero (no ISRC) or printable ASCII (A-Z 0-9 -) per ISO 3901 (without hyphen formatting).

Definition in file optical.h.

## Typedef Documentation

## ◆ TrackEntry

typedef struct TrackEntry TrackEntry

## ◆ TracksHeader

typedef struct TracksHeader TracksHeader