Skip to content

Player: a paused seek or reload re-pauses only once the video plane shows the frame - #759

Merged
GLinnik21 merged 1 commit into
mainfrom
fix/paused-frame-plane-bind
Oct 15, 2026
Merged

GLinnik21 merged 1 commit into
mainfrom
fix/paused-frame-plane-bind

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Problem

#722 and #750 show one frame while paused: after a paused seek that reloads the stream, and after an audio-track switch while paused. On the TV that frame never reached the panel. The log said seek: paused frame restored, but a VIDEO-only capture read "no signal state" and the screen stayed black until Resume.

Cause

  • The landing check re-paused once SHARED.frames >= 1. frames counts Starfish FRAMEREADY position ticks (~5 Hz), not displayed frames.
  • On the ACB route (webOS 4) the video plane binds only through setMediaVideoData, then acb_start (setDisplayWindow + PLAYING). That bind was gated on frames >= 2.
  • The preroll re-paused at tick 1. A paused pipeline sends no further ticks, so the plane never bound.
  • The re-pause's ACB mirror is a no-op below Streaming.
  • If a late tick did bind after the re-pause, ACB was left PLAYING under a paused pipeline.

Fix (pump.rs, Rust call ordering only — no FFI change)

  1. The landing waits for the picture. With ACB, the landing predicate also requires the plane to be bound (Streaming) and one tick after the bind. pause() then mirrors ACB PAUSED.
  2. Bind earlier while a preroll is open. The bind gate is 1 tick while a preroll is open. Normal starts keep 2, per the original "decoder is producing frames" rationale. This keeps the preroll's Play window short.
  3. ACB never runs under a paused pipeline. If acb_start runs while the viewer is paused and no preroll is open, the ACB pause follows.

Tests

Watched red on main, green after:

  • a paused ACB preroll does not re-pause before the plane is bound;
  • an open ACB preroll binds at the first tick;
  • an ACB start under a paused pipeline is followed by the ACB pause.

Guard, green both ways: a normal ACB start still waits for the second tick.

Verification

  • make check: test result: ok. 1781 passed; 0 failed; 60 ignored and test result: ok. 1638 passed; 0 failed; 60 ignored (other crates ok).
  • --no-default-features check is clean.
  • TV (webOS 4.5, pipeline harness, synthetic token, panel on): six paused landings, 8 captures, all PASS. For each, the VIDEO-only capture shows the fixture frame (no "no signal") and the DISPLAY capture shows the picture with the paused HUD and no spinner. In the log the bind precedes paused frame restored, the position stays put while paused, and Resume plays on.
Run Landings
audio-track switch while paused 3
paused reload seek 2 runs, 3 landings
paused native seek 1 run, 2 landings

Known trade-off: the preroll plays for about 0.2–0.3 s (+208 to +292 ms of position) with audio before it re-pauses. The player has no mute for that window. Before this change the window was similar, but no picture appeared.

🤖 Generated with Claude Code

…eo plane is bound

The landing re-paused at the first FRAMEREADY position tick, below Stage::Streaming: setMediaVideoData + acb_start never ran, acb_mirror_playstate did nothing, and the panel stayed black until Resume. The landing now needs the bind plus one tick after it; an open preroll binds at the first tick instead of the second; an acb_start under a really-paused pipeline is followed by the ACB pause.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit bb9fdd0 into main Oct 15, 2026
17 checks passed
@GLinnik21
GLinnik21 deleted the fix/paused-frame-plane-bind branch October 15, 2026 14:41
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.

1 participant