BufferPolicy

data class BufferPolicy(val readyDuration: Duration = 1.seconds, val readyPackets: Int = 25, val softTarget: Duration = 5.seconds, val totalBytes: Long = 32L * 1024 * 1024, val totalDuration: Duration = 30.seconds, val videoFrameQueue: Int = 4, val stallTimeout: Duration = 30.seconds)

How much to read ahead, when to declare that playback can start, and how long to wait for a source that stopped answering.

The read-ahead defaults come from the values ffplay and mpv converged on after a decade of bug reports. Do not retune them without evidence from real content.

Constructors

Link copied to clipboard
constructor(readyDuration: Duration = 1.seconds, readyPackets: Int = 25, softTarget: Duration = 5.seconds, totalBytes: Long = 32L * 1024 * 1024, totalDuration: Duration = 30.seconds, videoFrameQueue: Int = 4, stallTimeout: Duration = 30.seconds)

Properties

Link copied to clipboard

A stream is ready when it has this much buffered, or this many packets, or has ended.

Link copied to clipboard
Link copied to clipboard

Per-stream soft target. Exceeding it only marks the stream as well buffered.

Link copied to clipboard

How long a read may wait without progress before the session ends with PlaybackError.SourceStalled. Duration.INFINITE waits for ever.

Link copied to clipboard

The demux worker stalls when the total across all streams reaches either of these.

Link copied to clipboard
Link copied to clipboard

Decoded video frames held ahead of the one on screen. Bounded by the hardware pool.