Repository navigation
Player: a starved direct-play stream pauses and shows Buffering instead of slow motion - #1441
Merged
Merged
Conversation
…Buffering The clock-debt detector (playback-contract clock_debt) lands as an inert stub with its table tests, and the hostsim rig for a starved direct-play stream is added: a link at 0.4x, a dead link, the end of the stream, a viewer Pause/Resume inside a hold, and the streams that are never held (start, healthy, keeping pace, preview, Auto-watched, viewer Pause). Everything holding-related is red against this tree; the detector and the hold follow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A direct-play (Quality=Original) Feed stream whose link is slower than the file
played in slow motion over an empty queue and then dropped frames to catch up.
It is now held like an HLS rebuffer: the sink is paused, the viewer sees the
existing Buffering UI, and playback resumes when the video or audio queue is
full or the stream ends.
- ClockDebt (playback-contract): a pure CUSUM over the native position callback,
S <- max(0, S + (dwall - dpos) - k*dwall), k = 0.05, fire at S >= 100 ms, reset
whenever the video queue holds more than 1 MiB, disarmed until the first
picture, while priming and during a seek.
- play-feed: the begin rule steps ClockDebt once per position callback at the
unity rate; the dead-link arm (native_clock_stopped over the further lane's
reserve) also holds. The release is `queue full || EOF` with no runway
constant. One info line per hold and per resume.
- HoldRoute { SegmentedHls, ProgressiveOriginal, Unheld } carries the policy:
segmented HLS is unchanged; Quality=Auto's supervised Original, a fixed
quality's progressive re-encode and a trailer preview are never held.
- A viewer Pause/Play during the hold takes the paths PR #1439 gave the HLS
rebuffer hold (the hold keeps its own certificate; its Play clears the
Buffering mirror).
- ffi_host::silence_clock_for_test: a test-only way to stop the host position
thread without a Pause verb, so the dead-link arm is reachable in the rig.
Docs: player/CLAUDE.md and docs/adaptive-playback.md section 5.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…dit) The hold's certificate is a full queue or the end of the stream, not a runway; a non-1x rate disarms only the clock-debt arm; Original is the default only for a profile saved before Auto existed; the Auto supervisor's exits are section 7; the rebuffer read-out is no longer HLS-only; a Fired ClockDebt is not reset by a gap. Comments and Markdown only. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…must not begin a hold PR #1441's hostsim job failed `a_dead_link_is_held_through_the_silence_arm`, and the fw-compat review found a hold that can begin when its own release is already true. This commit holds only tests and test-support, so it is RED against the pump: - the dead-link test no longer waits on the real clock: the host's own position thread is hushed (`Rig::hushed`, `ffi_host::hush_ticker_for_test`, which also stops its real-time stamps from fighting the virtual wall) and the observation is aged with explicit stamps; - new: a link dying in the millisecond of the watch's restart, and one dying before the first callback after a viewer's Resume, must be held; - new: with the audio queue at its cap and the sink refusing audio (`ffi_host::refuse_feed_lane_for_test`), no hold may begin (no Pause then Play in one tick). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…releases at once 1. The dead-link arm required a position callback STRICTLY after the clock watch's last restart (`tick_since_watch_restart`, a helper this branch added; the HLS rule never had it). A link that died before the first callback after a viewer's Resume or a hold's Play, or in the very millisecond of the restart, was never held: a frozen picture and no Buffering. The progressive arm now reads the silence exactly as the HLS rule does, from the later of the last callback and the last restart (`silence_between`, wrap-aware), and the reserve test in `native_clock_stopped` keeps a resume that leaves a full queue from reading as dead. `tick_since_watch_restart` is deleted. 2. A hold could begin when its own release was already true (a video or audio queue at its byte cap), giving Starfish a Pause and a Play in the same tick, repeatedly. A parked queue now disarms the detector like a finished demuxer (`ProgressiveStall::queue_parked`). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…the tail re-primes) CI showed the real Pause/Resume variant never held: a viewer's Resume re-primes the clock and the nearly empty queue at the tail never primes, so the detector stays disarmed for a reason unrelated to the silence rule. The rig now sets the state the Pause or a hold's Play leaves (last callback older than the watch's restart) directly. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21
marked this pull request as ready for review
November 18, 2026 02:21
nphil
added a commit
to nphil/Marquee
that referenced
this pull request
Nov 18, 2026
A film played at Original quality over a link slower than the file kept playing as its queues ran dry: the picture ran in slow motion and the sink then dropped frames to catch up. Only HLS had a rebuffer hold. The pump now holds a progressive stream the same way (one Pause, the Buffering read-out, the try_prime Play). The hold begins when the native position falls more than 100 ms behind the wall, net of a 5 % drift allowance, while the app's video queue holds under 1 MiB, or when the native clock stops over a remnant it will never spend. It releases on a full video or audio queue or the end of the stream, never on a runway. The debt constants are upstream's, measured on its TV, not yet on this one. stall_watch stays the reporter and the restarter of a source parked on a full lane; a hold never begins while a queue is at its cap, so the two never act on one stall. A seek takes the clock from a hold at once. The silence clock is wrap-safe and the position tick is published last, with Release. A Play pressed while a held prime waits (plxnative#1439) needs no port: resume already defers the Play to the hold's release. Ported from upstream 9f5ff48 (Player: a starved direct-play stream pauses and shows Buffering instead of slow motion (plxnative#1441)).
tiper
added a commit
to tiper/fin-native
that referenced
this pull request
Nov 18, 2026
Merges PlxNative main up to 9f5ff48 (plxnative#1441).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When a direct-play (progressive Original) Feed stream is starved by a link slower than the
file, the player now pauses and shows Buffering until the queue is full, instead of letting the
TV play in slow motion and then catch up by dropping frames.
k = 0.05; hold when S ≥ 100 ms. S resets while the video queue holds more than 1 MiB and is
disarmed while priming, seeking and before the first picture. A dead link (position callbacks
stop) holds through the silence arm.
headroom.
HLS; a fixed-quality re-encode and trailer previews are not held.
Why these constants (TV measurements, mock server)
repays the debt by dropping frames; a reserve threshold cannot detect it.
Trigger 0.4 s → ~12 frames per resume, 0.2 s → ~6.6, 0.1 s → ~3.6.
11 times in 180 s, each ending
fullafter ~10.5 s, and plays normally after the link recovers.Tests
ClockDebttable tests (11), failing on the tests-first commit's stub.progressive_rebuffer_pump_tests.rs): a starved stream is held and readsBuffering; a 0.4× link holds; a dead link holds through the silence arm; EOF releases; a viewer
Pause/Play inside a hold stays held; never held for a full-rate stream, a link that keeps pace,
a preview, an Auto-watched Original, or a fixed-quality re-encode.
held_prime_playrows for the progressive hold.Gates
make test-crate C=plx_playback_contract:test result: ok. 54 passed; 0 failedmake test-crate C=plx_play_feed:test result: ok. 351 passed; 0 failedmake test-crate C=plx_media:test result: ok. 2152 passed; 0 failed; 104 ignoredmake test-hostsim C=plx_media T=progressive_rebuffer: 22 passed, then the dead-link test fixed and passing alone.make check-nodef: ok.ci/check-deps.sh, module layers, ledger ratchet, list-caps: green.make check, the full hostsim pass and the ARM build: gated by CI (the local runs wererefused by the disk preflight).
TV verification (this head's debug build, mock server, Guest)
reason=full, 2-6 frames dropped per resume (mean 3.9); none before the throttle or after it lifted.full, no reload; the HUD shows the Buffering spinner during the hold.reason=eof(EOS pushed while held, then Play); playback reached 564 s of 566 s and ended normally.auto: Original -> HLS, 0 progressive holds.🤖 Generated with Claude Code