Repository navigation
chore(player): preserve Rhainland's stall fix history - #653
Merged
Merged
Conversation
During direct play with the server stopped mid-stream, video kept playing from the read-ahead buffer for about four minutes while the "Loading…" capsule showed the whole time and the player controls stayed hidden. Aether reports a source reconnect as PlaybackPhase.stalled ahead of every other phase, even while frames keep advancing, and PlayerViewModel mapped .stalled straight to isLoading. isLoading drives the capsule, hides the controls, and pauses the intro-skip and credits logic. PlayerStallPresentation now decides isLoading from the phase. Over a stalled source the player is loading only while it means to play and, for at least one second, either the playhead has not moved or the engine has held no media ahead of its clock. The second case covers a seek past the buffer: Aether's clock then runs on without a frame, so a moving playhead alone does not prove playback. An audio-only load has no buffer-ahead reading and is judged by its playhead. PlayerViewModel records when the playhead last moved and when the buffer ran out and, while the phase stays .stalled, checks again every 250 ms, so the capsule appears once the buffer runs out and clears when frames move again. A real rebuffer on the AVPlayer path still shows through isBuffering, and .loading and .rebuffering are unchanged. Tests cover a reconnecting source with a moving playhead, a stopped playhead, no playhead sample yet, a running clock with nothing buffered ahead, a paused player, and the other phases. Found during the Series validation, silo-apple#337.
A replan, credential reload or new start sets isLoading before it waits for the server, while the outgoing load still reports its phase. When that load's source was stalled but still playing from its buffer, the stall watcher re-judged the phase within 250 ms and cleared isLoading. The Loading capsule went away and the intro-skip prompt resumed while the replacement plan was still being prepared. A replan sent while the server is down can wait for its request timeout, so this lasted seconds. PlayerStallPresentation now takes whether a replacement is being prepared, and a stalled phase stays loading while it is. Other phases keep their meaning, so a playing or paused outgoing load still reports as before.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks
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.
PR #641 closed after its rebase found that both commits had already shipped in #620. This replacement preserves the original commits and gives @Rhainland credit for the player stall fix and its regression tests.
Rhainland implemented the loading decision for a stalled source, including the empty-buffer check and the guard that keeps loading visible while a replacement plan is prepared. The original commits,
e61f8105and974a73c8, retain Rhainland's authorship in this branch. A reconciliation merge preserves the currentmaintree, so this PR has no source changes againstmain.Related PRs: #641, #620. Related validation issue: #337.
Validation
mainat34cedf4dbf5e4f320a01fcad810b9865bdb4cd19exactly.git diff --checkandscripts/ci/check-no-api-v1.shpass.Risks and follow-up
This PR records the original commit history for a fix already present on
main. No additional implementation work is required.AI Disclosure
gpt-6.1-sol, Codex harness running in T3 Code; tools: Git, GitHub CLI, Python, T3 Code MCP.claude-opus-5-5, Claude Code running in T3 Code, and Claude Code subagents.