Files
craft-libs/crates
f19f131247 craft-audio: a damaged FLAC keeps its timing; AAC uses BitReader::peek (#846)
* craft-audio: AAC Huffman lookahead uses BitReader::peek

`BitReader::peek` reads from one 8-byte load since the bit reader was made
faster, which is what the AAC decoder's private `peek32` did. The private copy
goes; the lookahead is the same zero-padded 32 bits.

Ported from storytold/filmcraft#4232.

* craft-audio: a damaged FLAC keeps its length and timing

symphonia's FLAC demuxer drops a frame whose checksum fails and resyncs on the
next one, so the decoder never saw an error: the file decoded shorter and all
later audio came out one block early, with `damaged` at 0.

The jump in the packet timestamps is the audio that was lost. It is returned
as silence, in blocks of at most 65 536 frames, and counted once in
`AudioInfo::damaged`. It never passes the length the file declares; with no
declared length a jump of more than 2^20 frames is not believed. A seek into
the lost frames lands on silence at the right position.

Ported from storytold/soundcraft#556, onto the streaming decoder.

---------

Co-authored-by: vangel76 <vangel1976@googlemail.com>
Co-authored-by: Gert Pellin <gert@pellin.be>
2026-11-11 15:25:53 -05:00
..
2026-11-05 10:29:52 +01:00
…