Pts

value class Pts(val micros: Long) : Comparable<Pts>

A presentation timestamp on the media timeline, in microseconds.

Microseconds because that is FFmpeg's own AV_TIME_BASE, so no conversion happens at the boundary, and because a 64-bit microsecond counter covers 292 000 years.

This is a value class rather than a Long on purpose. The largest single source of subtle bugs in every player's timing code is naked numbers in mixed units: media time and wall time, seconds and nanoseconds, values already divided by playback speed and values not yet divided. Making the unit part of the type turns those mistakes into compile errors.

There is no sentinel for "absent". A timestamp that may be missing is a Pts?, so the compiler asks for the check that FFmpeg's AV_NOPTS_VALUE leaves to the reader.

Constructors

Link copied to clipboard
constructor(micros: Long)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun coerceAtLeast(minimum: Pts): Pts
Link copied to clipboard
open operator override fun compareTo(other: Pts): Int
Link copied to clipboard
operator fun minus(other: Pts): Duration

The interval from other to this. Positive when this is later.

operator fun minus(duration: Duration): Pts
Link copied to clipboard
operator fun plus(duration: Duration): Pts
Link copied to clipboard
open override fun toString(): String