forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 03dc6e9978cbbbba112bf5c6ad925845ede8c744Filtered to shims/symphonia/src/reader.rsClear filter

2026-08-14

fix(probe): the head of a file is exact, and a default track is the flagged oneAhmet Kaan Gümüş · c665d19
fix(probe): the head of a file is exact, and a default track is the flagged one

Three gaps the symphonia swap (edith W7) found, all at the start of a file or
at the pick of a track:

- **An MP3 is gapless.** The LAME tag's encoder delay and padding went unread,
  so a `.mp3` claimed the silence around its sound as part of it and its
  samples arrived 25 ms behind the `.flac` of the same tone.
  `StreamInfo::initial_padding` now states the delay (the tag's, plus Layer
  III's own 529 samples of synthesis delay) and the duration ends at the last
  audible sample. Measured against ffmpeg on eight fixtures and three files of
  a real library: lag 0, correlation 1.0000, where the mp3 was 1105 samples
  late before.
- **A seek to the beginning goes there.** `candidate` started at the nearest
  *cue*, and a cue naming another track can sit past our own first block: this
  muxer opens a cluster at every video keyframe and cues the video alone, so a
  file whose first cluster holds only sound lost that cluster on every seek to
  zero. Another track's cue now backs off one entry, and a target before
  everything indexed starts at the first cluster.
- **`FlagDefault` picks the track.** `default_stream` answered with the first
  stream of a kind, so a dual-audio remux that marked its second track default
  opened in the other language. `StreamInfo::default` carries the flag where a
  file really wrote it (the element's absent value is 1, which is why
  "flagged" and "eligible" have to be different questions), and the symphonia
  shim's `default_track` reads it.

The shim gains the surface that carries these: `Track::delay`, the umbrella's
feature names (no-ops -- ec-probe serves every format unconditionally -- but a
`[patch.crates-io]` consumer naming `features = ["mkv"]` must still resolve).

Checks: `ec_probe` `the_head_of_a_file_is_exact` (gapless arithmetic exact
against ffmpeg, and no seek lands past a first packet) and `ec_matroska`
`the_first_cluster_is_reachable_when_no_cue_names_it` (fails without the cue
back-off: the audio restarts at 21 ms instead of 0).
feat(shims): symphonia, symphonia-core and symphonia-codec-aac over ec-probeAhmet Kaan Gümüş · 32195c9
feat(shims): symphonia, symphonia-core and symphonia-codec-aac over ec-probe

Exactly the surface edith consumes (audio.rs:36-53 and its call sites):
the probe and codec registries, the format reader and audio decoder
traits, tracks, packets, units and the AAC decoder seat. Written from
those call shapes and the crates' published documentation; no symphonia
source was read (MPL-2.0 incumbent, MIT OR Apache-2.0 family).

Two incumbent defects are gone rather than worked around, and each has a
test: a Matroska seek is reliable more than once per reader (edith opens
a new reader per attempt because the incumbent's is not), and a
multichannel AAC track decodes instead of 'aac: aac too complex'.

The shim test drives every call edith makes, in the shape edith makes
it, over nine fixtures.