Skip to content

player: seek in place on webOS 5+ through LG's public Seek, no reload per seek (#568) - #713

Merged
GLinnik21 merged 3 commits into
mainfrom
fix/568-native-seek
Oct 15, 2026
Merged

GLinnik21 merged 3 commits into
mainfrom
fix/568-native-seek

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #568

On webOS 5 and newer every direct-play seek tore the player down and issued a fresh Starfish Load: a black screen for a moment, and on HDR / Dolby Vision content the TV's format badge again. The in-place seek (flush + setTimeToDecode/setContentInfo + CustomPipeline::sendSegmentEvent) was disabled there on purpose, because it reaches LG-private objects through offsets only ever read off a webOS 4.5 binary.

This routes webOS 5+ seeks through LG's public StarfishMediaAPIs::Seek(const char *millis) instead. It depends on no object layout. LG's own Chromium MSE player uses it in the same buffer-feed mode, and it is exported on every firmware inventory from 2.2.3 to 11.2.0.

What changes

  • The bool INPLACE_SEEK_OK becomes a per-session SeekMode:
    • Segment: webOS 4.x, unchanged.
    • NativeSeek: VP_EXPORTED, i.e. webOS 5+.
    • Reload: old-ABI 3.x, unchanged.
  • In NativeSeek mode the pump skips flush(), because LG's Seek flushes itself and a flush() after it would re-create the stale-segment stall.
  • On the first post-seek keyframe, the feed switches to content time (pts_shift = 0) and calls Seek(keyframe_ms) before that keyframe is fed.
  • Refused Seek:
    • This seek reloads exactly once, at the user's target.
    • Nothing is anchored or fed meanwhile, and the private-offset Segment path can never run outside Segment mode.
    • The rest of the same playback stays on reload-per-seek; a new playback tries Seek again.
  • C seam: sf_seek_ms, guarded by sf_ready_object(). Sink trait: VideoSink::seek, plus a host fake.
  • Dev trigger /tmp/plxnative-seekmode (native|segment|reload), so the webOS 4.5 dev set can exercise the new path. It is inert without devtriggers.
  • docs/webos5-port.md gains a section on the decompiled Seek chain, marking what is proven and what is inferred.

Evidence

  • Decompile (webOS 4.5 libplayerAPIs + libpf):
    • Chain: Seek → AbstractPlayer::seek → CustomPlayer::seekSpi → CustomPipeline::seekSpi, which does gst_element_seek(FLUSH|KEY_UNIT, start = ms).
    • Units are milliseconds; a negative target is refused.
    • No Load, caps change, HDR re-send or decoder reopen anywhere on the seek path.
  • Host tests (hostsim):
    • Engine tests for mode selection, the keyframe seek, a pre-zero keyframe and the refusal fallback.
    • Pump-level tests that tick the real pump and feed_stream. They check no flush, one Seek at the keyframe and no reload; a refusal giving exactly one reload_at at the target even when the stuck watchdog fires first, with zero Segment calls; and later seeks in the playback reloading without Seek.
    • With the fixes reverted, the routing and refusal tests failed: 3 of 5 engine tests, then 2 of 3 pump tests.
  • TV (webOS 4.5, NativeSeek forced via the dev trigger, 300 s 4K HEVC HDR10 + E-AC-3, direct play):
    • Four tap seeks, forward and back: every Seek(...) rv=1, pts_shift=0, one SEEKDONE each, 0 fresh Loads, landing on target.
    • A burst of 8 taps coalesced to one Seek, with 0 Loads.
    • 130 s of playback after the last seek: no BufferFull, no error.
    • The Segment control behaves the same.
  • fw-compat review: PASS on 4.4.2 through 11.2.0. DT_NEEDED unchanged; PKc arg and bool return correct on AAPCS.

Not verified

  • webOS 5+ on a real set: our only television is webOS 4.5. The reporter will be asked to test a nightly carrying this.
  • A seek while paused, on the TV: the dev harness's paused case reloaded in both modes. That is an artefact of the dev seek trigger: it issues a bare request_seek without opening the paused-seek preroll, so the pump's TX.feed_allowed() gate stays shut. A viewer's scrub while paused goes through begin_paused_seek and does not hit that gate. The scrub-while-paused path in NativeSeek mode has not been observed on a set; the trigger fix is a follow-up.

🤖 Generated with Claude Code

GLinnik21 and others added 3 commits October 15, 2026 00:02
…Is::Seek (#568)

On VP_EXPORTED every direct-play seek was a full fresh Load (black screen, DV/HDR badge
re-pop) because the Kodi in-place path reads decompile-derived private offsets proven only
on webOS 4.5. Replace the INPLACE_SEEK_OK bool by a per-session SeekMode (Segment,
NativeSeek, Reload): VP_EXPORTED selects NativeSeek, which calls the exported
Seek(millis) from feed_stream on the landed keyframe with content-time PTS (pts_shift 0).
The pump skips flush() for it (Seek flushes itself; a flush is a seek to 0). A refused
Seek downgrades the session to Reload and re-posts the target for reload_at. webOS 4.x
keeps Segment; old-ABI 3.x stays Reload. /tmp/plxnative-seekmode (dev builds) forces a mode.
Decompile evidence recorded in docs/webos5-port.md.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…es the Segment path, and stays refused for the playback (#568)

- feed_stream: the private-offset Segment branch runs only in SeekMode::Segment; a flushed
  keyframe in any other mode anchors nothing and waits for the reload.
- pump: the stuck watchdog goes straight to reload_at in Reload mode instead of re-publishing an
  av_seek.
- A native_seek_refused latch survives reload_at (session_seek_mode) and is cleared by a fresh play.
- Pump-level hostsim tests (success, refusal past the stuck watchdog, later seeks), probes in
  ffi_host / engine; wording fixes in engine.rs, mod.rs, webos5-port.md, player/CLAUDE.md.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit a724e3a into main Oct 15, 2026
17 checks passed
@GLinnik21
GLinnik21 deleted the fix/568-native-seek branch October 15, 2026 00:03
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.

Seeking reloads the media

1 participant