pub const DEFAULT_MAX_CHAPTERS: u32 = 4096;Expand description
Default ceiling on the number of chapters a container may declare — 4096.
Why this number. A DVD’s chapter count tops out at 99, a Matroska edition rarely reaches three figures, and the fattest real table anyone ships is an audiobook filing each of its tracks as a chapter — a few thousand at the far end. 4096 clears all of that and still bounds this crate’s mirror at a few hundred kibibytes.
Why a ceiling exists at all. A chapter costs libavformat almost
nothing — an AVChapter is four scalars and a dictionary pointer —
so a header can declare an enormous table for very few bytes, and
DEFAULT_MAX_STREAMS does not reach it: chapters are not streams.
The mirror this crate builds is the larger of the two (an owned
title, a Timebase, two Timestamps per row), so the count is
judged before a byte of it is reserved.