Repository navigation
A looping playback (read, decode, trim, and at the end rewind, reset, new Trim) now allocates nothing after its first pass, which matters on an audio thread where an allocation can take a lock.
Added
OggOpusReader::read_packet_intofills anOggPacketthe caller keeps, whereread_packetreturns a new one.OggPacket::default()is the empty one to start from.OggOpusReader::rewindreturns a seekable source to the first audio packet without reading the header pages again. It replaces rebuilding the reader to loop.
Changed
- Reading and decoding no longer allocate once warm, loop points included: the Ogg reader reassembles packets in one reused buffer, the packet parser holds its frame table inline, the range decoder borrows the packet, and the multistream decoder reuses one buffer per stream.
tests/ogg_playback_alloc.rsholds it to zero. OpusDecoder::reset_stateresets in place instead of building a new decoder, so it no longer allocates; a reset decoder still decodes bit for bit as a new one.- The Ogg reader refuses a stream whose comment header does not finish its page, as RFC 7845 §3 requires and libopusfile enforces, and caps a reassembled packet at 16 MiB, so a hostile chain of continued pages cannot grow its buffer without limit.
RangeCoder::shrinkchecks its size preconditions in release builds.
Additive otherwise: nothing was removed from the 0.2.1 public surface.