Skip to main content

presentation_slack

Function presentation_slack 

Source
pub fn presentation_slack(num: i64, den: i64, quantum: i64) -> MediaTime
Expand description

How much later than source time t a decoded frame’s timestamp may be and still be the frame shown at t, for a num / den time base rounded to quantum units (rounding_quantum, 0 for none).

A frame timestamp is its true time rounded to the stream’s unit and then to the tick grid, while sampled times are floored (crate::FrameRate::frame_start). A 29.97 fps Matroska file stores its third frame (66.73 ms) at 67 ms, 32 ticks after the project frame that shows it. The slack is half the rounding unit (or half the time-base unit when no rounding shows, capped at PRESENTATION_SLACK) rounded up to a tick, plus one tick. Hosts show the last frame at or before MediaTime::presentation_deadline.

A non-positive num or den returns PRESENTATION_SLACK; a negative quantum means none.