Stop naming specific commercial discs in comments and tests

Fifteen references across six files named the discs a defect was first
seen on. The parser leak found earlier was not an isolated slip — the
same habit runs through the mux comments, the changelog and the AACS
content verdict, where a title name was standing in for the shape of
the problem.

Every one is replaced with the property that actually mattered: a
multi-clip title, a UHD Dolby Vision profile 7 dual-layer stream, a
disc carrying an authored-bad TS packet. The comments are more useful
for it — the reader needs to recognise the shape on a disc they have,
not the one we happened to have.

`SEG_MainFeature` stays: the parser matches on that literal, so it is
a format token rather than a title.
This commit is contained in:
Matthew Jackson
2026-08-02 17:00:10 -07:00
parent c94e9f4fb7
commit b68765fe84
7 changed files with 17 additions and 18 deletions
+2 -2
View File
@@ -967,7 +967,7 @@ mod tests {
// mark this boundary ext_clean=false and the parser must emit the clean
// 512-byte CORE alone (dropping the garbage), draining to the next core.
let core = make_dts_core(512);
let garbage = vec![0xE4, 0x3F, 0xE3, 0x90, 0xCC, 0x6C]; // real Bourne head bytes
let garbage = vec![0xE4, 0x3F, 0xE3, 0x90, 0xCC, 0x6C]; // real head bytes from a damaged stream
let mut garbage = garbage;
garbage.extend(std::iter::repeat_n(0xAB, 300));
let next = make_dts_core(512);
@@ -2222,7 +2222,7 @@ mod tests {
/// Real-data fixture (ignored). Re-parses a raw `.dts` elementary stream
/// through `DtsParser` and writes the emitted access units back out, so the
/// garbage-extension → core-only drop can be validated against an actual
/// damaged stream (e.g. the extracted Bourne DTS-HD MA track) end-to-end
/// damaged stream (e.g. an extracted DTS-HD MA track) end-to-end
/// with an external DTS decoder. Env: `DTS_IN` (input), `DTS_OUT` (output).
/// cargo test --lib dts::tests::reparse_real_dts_file -- --ignored --nocapture
#[test]
+3 -3
View File
@@ -533,8 +533,8 @@ impl CodecParser for HevcParser {
// CRA→BLA rewrite (`pending_clip_boundary`) the first IRAP of the new
// clip then consumes. Without this, the splice CRA's RASL leading
// pictures reference pre-join frames gone after concatenation and a
// linear decoder floods "Could not find ref with POC N" (the Top Gun
// UHD defect). Uses the 90 kHz PES PTS (not the rebased mux timeline)
// linear decoder floods "Could not find ref with POC N" (the UHD
// multi-clip defect). Uses the 90 kHz PES PTS (not the rebased mux timeline)
// UNWRAPPED onto a monotonic 64-bit timeline first — the raw 33-bit PTS
// wraps every ~26.5 h, and a single-clip title that crosses 2^33→0 would
// otherwise false-arm the rewrite (corrupting a legitimate in-clip CRA).
@@ -2197,7 +2197,7 @@ mod tests {
);
}
/// Regression for the "TopGun bug" (Top Gun 1986 UHD, DV P7 dual-layer):
/// Regression for a UHD Dolby Vision profile 7 dual-layer title:
/// a multi-clip title is read as one concatenated stream and the mpls
/// connection_condition is never plumbed to the parser, so the splice CRA
/// opening the next clip kept its dangling RASL leading pictures and a
+3 -4
View File
@@ -403,8 +403,7 @@ impl CodecParser for TrueHdParser {
// global offset for the new epoch (driven by the video
// back-jump) the stranded-high audio PTS is flung ~a whole
// clip past the frontier, producing the non-monotonic
// audio-DTS band on multi-clip titles (Dune: Part Two, Top
// Gun). ADOPT the raw reset so the per-track raw PTS that
// audio-DTS band on multi-clip titles. ADOPT the raw reset so the per-track raw PTS that
// reaches `TimelineContinuity` carries the true boundary, and
// the corrector rebases it exactly as it already does for the
// DTS / AC-3 parsers (which never clamp). Same threshold the
@@ -1304,7 +1303,7 @@ mod tests {
// When the buffer empties exactly on that boundary, an unconditional
// reset to the PES PTS snapped the next AU's timestamp BELOW the AU just
// emitted — the non-monotonic block timestamps a muxer rejects (the
// Top Gun / Dune: Part Two case). The reset must clamp forward-only.
// multi-clip UHD case). The reset must clamp forward-only.
let mut parser = TrueHdParser::new();
let au = make_truehd_unit(100);
// PES1: three complete AUs at pts 90000 — buffer empties, cadence runs
@@ -1329,7 +1328,7 @@ mod tests {
#[test]
fn clip_boundary_pts_reset_is_adopted_not_clamped() {
// Regression (Dune: Part Two / Top Gun non-monotonic audio-DTS band):
// Regression (multi-clip non-monotonic audio-DTS band):
// a title's clips are read as one concatenated stream, so at a
// non-seamless boundary the source PES PTS resets near zero — a LARGE
// backward step (> DISCONTINUITY_BACKSTEP_NS), NOT muxer jitter. The
+1 -1
View File
@@ -1373,7 +1373,7 @@ impl<W: Write + Seek> MkvMuxer<W> {
// with the base layer's. The two video PTS sequences overlap, so the EL's
// frames look like multi-second backward jumps against the base layer's
// frontier and would false-trigger an epoch reset on every GOP (the exact
// ratchet that inflated Top Gun's 1-clip timeline to ~7 h). Only the base
// ratchet that inflated a 1-clip timeline to ~7 h). Only the base
// video layer establishes/advances the frontier and opens epochs; the EL
// — like audio and subtitles — rides the current offset.
let drives_epoch = Some(track_idx) == self.primary_video_track;
+6 -6
View File
@@ -32,14 +32,14 @@ pub(crate) const DISCONTINUITY_GAP_NS: i64 = 1_000_000;
/// boundary resets every stream together by the same delta.
///
/// **Only the VIDEO track drives epoch decisions.** A title carries one video
/// track plus many interleaved audio + subtitle tracks (Top Gun UHD: 2 video,
/// track plus many interleaved audio + subtitle tracks (one UHD title: 2 video,
/// 11 audio, 32 PGS). Those non-video tracks are sparse and lag the video by
/// seconds, so their raw PTS swing well over the 3 s discontinuity threshold
/// against a shared frontier even within a SINGLE clip — a late subtitle PTS
/// would ratchet `high_ns` up, then the next normal video frame would sit >3 s
/// below it and be misread as a clip boundary, permanently bumping `offset_ns`.
/// That false-positive ratchet (firing thousands of times on a one-clip title)
/// inflated Top Gun's cluster/Cue timestamps into the billions of ms and
/// inflated that title's cluster/Cue timestamps into the billions of ms and
/// destroyed its seek index. The clip-boundary INFERENCE is therefore keyed on
/// video PTS alone: video establishes and advances the frontier and is the only
/// track that can open a new epoch. Non-video frames are remapped under the
@@ -200,7 +200,7 @@ mod tests {
/// Characterization of the BUG: a BD title's two clips concatenated with a
/// PTS reset at the boundary. WITHOUT correction the raw VIDEO timeline goes
/// hard backward at clip 2 (what produced the non-monotonic-DTS band on
/// Dune / Top Gun). WITH `TimelineContinuity` the output is monotonic and
/// multi-clip UHD titles). WITH `TimelineContinuity` the output is monotonic and
/// continuous across the boundary. The boundary is driven by VIDEO.
#[test]
fn continuity_rebases_clip_boundary_reset() {
@@ -256,7 +256,7 @@ mod tests {
/// PRIMARY rc3 regression: a sparse, lagging NON-VIDEO track (PGS subtitle /
/// trailing audio) on a SINGLE-clip title must NOT inflate `offset_ns`. This
/// is the exact false-positive that destroyed Top Gun's seek index: with a
/// is the exact false-positive that destroyed a real title's seek index: with a
/// shared frontier, a late subtitle PTS ratcheted the frontier up, then the
/// next normal video frame sat >3s below it and was misread as a clip
/// boundary, permanently bumping the offset — thousands of times, until the
@@ -307,7 +307,7 @@ mod tests {
/// PASSIVE rider (drives_epoch == false): if it drove epochs, every EL GOP
/// would look like a multi-second backward jump against the base-layer
/// frontier and false-trigger a clip-boundary reset — the exact ratchet that
/// inflated Top Gun's 1-clip 1h49m timeline to ~7 h. Here the base layer
/// inflated a 1-clip 1h49m timeline to ~7 h. Here the base layer
/// advances 0..60s while the EL re-emits the SAME 0..60s interleaved; the
/// timeline must stay at 60s with offset 0.
#[test]
@@ -363,7 +363,7 @@ mod tests {
);
}
/// Regression for the original Top Gun band: a LARGE, real-magnitude
/// Regression for the originally-reported band: a LARGE, real-magnitude
/// clip-boundary back-jump on VIDEO (clip 1 ≈ 13 min, clip 2 resets to 0)
/// must STILL be rebased to one continuous monotonic timeline — the genuine
/// multi-clip seamless behaviour is preserved, now keyed on real video