Skip to content

Comments

Add skipInitialTimeSet to prevent seeking on live streams#27

Open
jaumecornado wants to merge 1 commit intoLePips:mainfrom
jaumecornado:fix/skip-initial-time-set-for-live-streams
Open

Add skipInitialTimeSet to prevent seeking on live streams#27
jaumecornado wants to merge 1 commit intoLePips:mainfrom
jaumecornado:fix/skip-initial-time-set-for-live-streams

Conversation

@jaumecornado
Copy link

Summary

  • Adds skipInitialTimeSet: Bool property to Configuration (default false, no breaking changes)
  • When true, setConfigurationValues skips the player.time = assignment, preventing VLC from seeking away from the live edge on live HLS streams
  • All other configuration values (rate, subtitles, audio, aspect fill) still apply normally

Fixes #26

Problem

setConfigurationValues unconditionally sets player.time = startTime (default .ticks(0)) the first time playback advances. For live HLS streams with timeshift buffers, this causes:

  1. VLC connects at the live edge correctly
  2. setConfigurationValues seeks to position 0 (start of timeshift buffer)
  3. VLC flushes buffers and re-acquires segments, causing 3+ minute rebuffer
  4. Playback resumes hours behind real-time

Even setting startTime to the current position causes VLC to flush buffers and rebuffer, because any player.time = X call triggers a seek in VLCKit.

Test plan

  • Verify live HLS stream with skipInitialTimeSet = true starts at live edge without rebuffering
  • Verify VOD playback with skipInitialTimeSet = false (default) behaves unchanged
  • Verify VOD playback with explicit startTime still seeks correctly

🤖 Generated with Claude Code

setConfigurationValues unconditionally sets player.time to startTime
(default 0) the first time playback ticks advance. For VOD content this
is correct, but for live HLS streams with timeshift buffers it causes
VLC to seek away from the live edge, triggering a long rebuffer
(observed 3+ minutes) or playback starting hours behind real-time.

Adding a `skipInitialTimeSet` flag on Configuration lets callers opt out
of the initial time assignment. When set to `true`, VLC keeps the
position it naturally chose (the live edge), and the rest of
setConfigurationValues (rate, subtitles, audio, aspect fill) still
applies normally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setConfigurationValues causes long rebuffer on live HLS streams

1 participant