Skip to main content

## duration_from_secs

# Function duration_from_secs

Source

    pub fn duration_from_secs(seconds: f64) -> Option<Duration>

Expand description

Seconds reported by an engine, as a `Duration`, without trusting the number.

`Duration::from_secs_f64` panics on a negative or non-finite value, and no engine promises otherwise. ExoPlayer reports `C.TIME_UNSET` — `Long::MIN_VALUE`, about -9.2e15 — for a stream whose length it does not know, which is every background-audio handoff: `/Audio/{id}/universal` is a chunked, length-less transcode.

Held as a float that junk was harmless. Converted to a `Duration` it became a panic that killed the backend mid-handoff and left a black screen with no controls. Every engine crossing into this contract goes through here.

TRACES: UR-005 | DR-252