Files
romm/docker
Sam Dornan 12ed0b2d8c feat(soundtrack): extract CD audio from CHD images too
Most disc libraries are stored as CHD, which wraps the tracks in
compressed hunks. Extraction now reads them through libchdr (BSD-3), a
small decode-only library loaded with ctypes:

- The CHT2/CHTR track metadata gives each track's type, frames and
  whether its pregap is stored; tracks are padded to four frames, and
  audio comes back big-endian, so flac reads it with --endian=big.
- A lone CHD in the platform folder is promoted into a folder of its own
  first, as an upload would. A lone cue sheet still gets the 409, since
  moving it would leave its bins behind.
- A disc with a CHD but no libchdr gets a 503, like a missing flac.
- Reading and encoding now go through one AudioSource per track, so cue
  bins and CHDs share the encoder.

libchdr is built from a pinned commit in its own stage for the
production image and in the dev image (Ubuntu 22.04 doesn't package
it); the pytest workflow installs libchdr0 and mame-tools, whose chdman
builds the CHD fixtures. GD-ROM (Dreamcast) CHDs aren't read yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014XHgJG3xRgUKwuHJHwKkPg
2026-09-25 21:48:21 +00:00
..
2026-04-12 09:35:34 -04:00