1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Shared PCR-discontinuity classification — a thin, stateful wrapper over
//! [`dvb_conformance::ConformanceMonitor`]'s ETSI TR 101 290 v1.4.1 Table 5.0b
//! indicator 2.3b (`PCR_discontinuity_indicator_error`) check.
//!
//! Both [`super::pcr_restamp`] (Interpolate mode's sane/corrupt decision) and
//! [`super::pcr_honor`] (setting `discontinuity_indicator` on a genuine break)
//! need the *same* answer to "is this PCR delta a genuine, unflagged
//! discontinuity, per the TR 101 290 100 ms threshold?". ts-fix does **not**
//! re-derive that threshold — [`PcrDiscDetector`] feeds every packet through
//! the real conformance monitor and asks whether indicator 2.3b fired, so any
//! future threshold tuning in `dvb-conformance` is picked up here for free.
//!
//! # Synthetic clock
//!
//! [`dvb_conformance::ConformanceMonitor::feed`] takes a caller-supplied
//! wall-clock [`Duration`] per packet. Indicator 2.3b's decision is derived
//! purely from the **PCR value delta** between consecutive PCRs on the same
//! PID (`check_pcr`'s `delta_ms` — not from the caller's `t`); `t` only gates
//! the *other* PCR indicator (2.3a, `PCR_repetition_error`) and the
//! PAT/PMT/SI presence timers, neither of which this detector consults. ts-fix
//! repair ops process a raw byte stream with no independent wall clock, so a
//! monotonically increasing synthetic per-packet counter is fed instead — it
//! is sufficient because only 2.3b events are read back out.
//!
//! # Spec
//!
//! ETSI TR 101 290 v1.4.1 §5.2.2, Table 5.0b, indicator 2.3b. ISO/IEC 13818-1
//! (= ITU-T H.222.0) §2.4.3.5 (`discontinuity_indicator`).
use Duration;
use ;
/// Incremental TR 101 290 §5.2.2 indicator 2.3b classifier.
pub