Skip to main content

Module availability

Module availability 

Source
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 - ATO
  • SegAvailEnd = AST + PeriodStart + MPDstart + 2 * MPDduration + TSB (SegAvailStart without 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 @availabilityTimeOffset seconds (possibly INF or 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_ticks at utc_us: the largest n with AST + 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_from for 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; None without a time-shift buffer depth (the segment never leaves the window).
segment_available_until_ticks
segment_available_until for a segment given in ticks.
ticks_to_us
Ticks to microseconds, rounded toward negative infinity.