Commits
Commits on
03dc6e9978cbbbba112bf5c6ad925845ede8c744Filtered to crates/ec-probe/src/lib.rsClear filter2026-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(probe): one sniffing reader and one decoder registry for every audio fileAhmet Kaan Gümüş · 51de303
feat(probe): one sniffing reader and one decoder registry for every audio file Content decides the format, never the extension: RIFF, fLaC, OggS, EBML and ftyp by magic, MP3 and ADTS by three chaining frames after any ID3 tag (a lone MPEG audio header turns up inside AAC payload often enough that a single sync is not evidence). WAV, MP3, FLAC and ADTS are demuxed here — one walk, four framings, a frame index built on the first seek so a landing is sample-accurate. Ogg, mp4 and Matroska are delegated to their own crates: there is one EBML parser in this family and it is ec-matroska (cargo tree -p ec-probe shows the edge). Everything is served on the one reader the file was opened with, however many times it is seeked. Reader::seek answers where it actually landed, which is the number a segment start is trimmed against. Reader::unsupported names every audio track with no decoder and why. Cover art is not a video track and never appears as one. Tags: ID3v1/v2 and Vorbis comments; mp4 ilst is not read (edith reads no metadata today) and says so in the module docs. Verified: 26-file fixture matrix (format, codec, channels, packet counts against ffprobe, sample counts against ffmpeg), 100 random seeks per file each landing at or before its target within the container's own granularity, and a 9-file sweep of the real library covering aac, ac3, eac3, opus, mp3 and a TrueHD remux whose unplayable track is listed.