This is the head patch of the native AC-4 submission stack: a
six-series stack that applies in one order with plain `git am` on
master 3e6cd5e: A0 (this patch) -> A (decoder) -> B (decoder
docs/FATE) -> C (encoder) -> E (TS mux) -> D (parser + MP4). Stack
parent: none. It teaches the raw .ac4 demuxer to fill codec
parameters and packet timestamps from the first frame, so that
stream copy exits 0 and output is seekable with sane pts. Every
later series (decoder, docs/FATE, encoder, TS mux, MP4) assumes this
behavior.

What: peek the first frame's TOC, publish sample rate / channel
layout / bit rate to codecpar, and derive packet duration from the
frame's samples-per-frame x sample-rate multiplier. Never publishes
the grid rate (frame-rate-derived rates such as 46034/51200 stay
internal; decoder latch decides final).

Why first: without params the demuxer cannot drive copy, seek, or the
mux round-trips the later FATE tests rely on. Raw-first ordering:
carriage params before codec.

The TOC walk is shared with the Series D frame parser
(libavcodec/ac4_toc.h) and the stream declares
need_parsing=HEADERS so the parser refines per-frame keyflags;
pre-D trees degrade to whole-frame KEY with identical goldens.

Testing:
  ffmpeg -i clip.ac4 -c:a copy -f null -
  ffprobe -show_streams clip.ac4   (rate/ch/bit_rate present)
  seek + remux checks; ASan + trasher over the peek path;
  standalone lavf demux build; patcheck clean.
Peek stays bounded (no 120 s slow-reject tails).

FATE: carried on this 1-patch submit (M3): fate-ac4-demux/-51
(demux.mak, FATE_SAMPLES_DEMUX) + fate-seek-extra-ac4 (seek.mak,
FATE_SEEK_EXTRA) with 3 refs. Needs ac4/clip-stereo.ac4 +
ac4/clip-51-real.ac4 live in fate-suite before post; samples mail
sent and suite live 2026-10-16T22:23:09Z (12/12) -- post at/after
the +24 h clock end (2026-10-17T22:23:09Z). Series B (B2) still
gated on this patch.

Open: fri-row positives for rows without real mult-info vectors
stay suite-gated; timestamp-seek NOPTS pins are infeasible in
seek.mak (seek_frame_generic forward-scans to target, so only byte
seeks land unvisited).

Provenance: independent cleanroom implementation in C, written from
the published ETSI specifications TS 103 190-1 V1.4.1 and TS 103 190-2
V1.3.1 plus black-box behavioral observation. No Dolby SDK, reference
code, or disassembly was used. Comments are original prose (a scrub
pass is folding stray internal pointers to table/clause citations).
Note AC-4 is covered by Dolby patents; this submission addresses
copyright-clean code only and implementers/distributors should
consider patent licensing.

Signed-off-by: Michael Rowlinson <[email protected]>
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to