Skip to main content

background_audio_plan

Function background_audio_plan 

Source
pub(super) fn background_audio_plan(
    is_local_file: bool,
    position_seconds: f64,
) -> BackgroundAudioPlan
Expand description

Decide the base and the seek for a handoff at position_seconds.

The two sources start in different places. An audio-only stream is built with StartTimeTicks, so the server makes the handoff point that stream’s zero: the base is the handoff position, and seeking would skip past the content by that much again. A downloaded file has no such parameter and begins at the episode’s own zero, so it needs the opposite — no base, and a real seek. Treating a file like a stream is why backgrounding a downloaded episode restarted it from 0:00 while the lockscreen showed the right time.

TRACES: UR-040, UR-071 | DR-180 | UT-181