Expand description
Segment availability arithmetic for dynamic MPDs (ISO/IEC 23009-1
5.3.9.5.3; DASH-IF IOP v4.3 4.3.3.2). Integer microseconds in i128, so
no input can wrap.
SegAvailStart = AST + PeriodStart + MPDstart + MPDduration - ATOSegAvailEnd = AST + PeriodStart + MPDstart + 2 * MPDduration + TSB(SegAvailStartwithout the ATO, plus one more duration and the time-shift buffer; Annex A.3.4 prints the same quantity)- Initialization Segment: available from
AST + PeriodStart(5.3.9.5.2).
Functionsยง
- ato_
seconds_ to_ us - Convert
@availabilityTimeOffsetseconds (possiblyINFor negative) to microseconds, clamped so later sums stay in range. A NaN is zero. - complete_
count_ constant - Number of complete segments of constant duration
duration_ticksatutc_us: the largestnwithAST + PS + n * d - ATO <= utc, computed exactly against per-segment microsecond rounding (floor(n * d * 1e6 / timescale)). - init_
available_ from - Availability start of the Initialization Segment.
- segment_
available_ from - Availability start of a Media Segment.
- segment_
available_ from_ ticks segment_available_fromfor a segment given in ticks: the end of the segment (MPDstart + MPDduration) is converted once, so rounding never accumulates.- segment_
available_ until - Availability end of a Media Segment;
Nonewithout a time-shift buffer depth (the segment never leaves the window). - segment_
available_ until_ ticks segment_available_untilfor a segment given in ticks.- ticks_
to_ us - Ticks to microseconds, rounded toward negative infinity.