fix(avplayer): deliver the frame at a jump while paused #893

Merged
merwie merged 1 commit from upstream-pr/893 into main 2026-10-06 21:17:07 +00:00
merwie commented 2026-10-06 13:20:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-06T13:20:58Z.


What

libSceAvPlayer (and .native, which shares the code) returned no video while paused, including right after a jump. Unity's video player prepares a clip in four steps:

  1. sceAvPlayerStart, then a few frames.
  2. sceAvPlayerPause, then sceAvPlayerJumpToTime(0).
  3. It polls sceAvPlayerGetVideoDataEx / sceAvPlayerIsActive until the frame at the jump arrives.
  4. Only then does it resume.

PPSA12544 (Hollow Knight: Silksong) does this for its intro cinematic. Traced on main:

sceAvPlayerStart -> 0
sceAvPlayerGetVideoDataEx #1..#6 -> 1
sceAvPlayerPause -> 0
sceAvPlayerJumpToTime -> 0
sceAvPlayerGetVideoDataEx #7.. -> 0   (forever)
sceAvPlayerIsActive -> 1

The screen stays black.

The change: while paused, the first frame after a jump (the first frame of a new epoch) is now delivered, and the paused clock is rebased to it. Every other frame is still held until the player resumes, as before. Player::GetVideoData accepts the paused state, and takeVideo holds frames of the current epoch while paused. shadPS4 also returns frames while paused, gated by its paused clock.

GuestAvPlayer now pauses, jumps to 300 ms, and expects that one frame (timestamp 300..367) and nothing after it while still paused. The existing "no data while paused" check still holds.

Tested

  • Windows 11, PPSA12544: the intro cinematic now plays (bring-up: #726).
  • guest_avplayer and the other non-GPU tests pass (212).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4759328609 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/893). Originally posted by [merwie](https://github.com/merwie) on 2026-10-06T13:20:58Z. --- ### What `libSceAvPlayer` (and `.native`, which shares the code) returned no video while paused, including right after a jump. Unity's video player prepares a clip in four steps: 1. `sceAvPlayerStart`, then a few frames. 2. `sceAvPlayerPause`, then `sceAvPlayerJumpToTime(0)`. 3. It polls `sceAvPlayerGetVideoDataEx` / `sceAvPlayerIsActive` until the frame at the jump arrives. 4. Only then does it resume. PPSA12544 (Hollow Knight: Silksong) does this for its intro cinematic. Traced on `main`: ``` sceAvPlayerStart -> 0 sceAvPlayerGetVideoDataEx #1..#6 -> 1 sceAvPlayerPause -> 0 sceAvPlayerJumpToTime -> 0 sceAvPlayerGetVideoDataEx #7.. -> 0 (forever) sceAvPlayerIsActive -> 1 ``` The screen stays black. The change: while paused, the first frame after a jump (the first frame of a new epoch) is now delivered, and the paused clock is rebased to it. Every other frame is still held until the player resumes, as before. `Player::GetVideoData` accepts the paused state, and `takeVideo` holds frames of the current epoch while paused. shadPS4 also returns frames while paused, gated by its paused clock. `GuestAvPlayer` now pauses, jumps to 300 ms, and expects that one frame (timestamp 300..367) and nothing after it while still paused. The existing "no data while paused" check still holds. ### Tested - Windows 11, PPSA12544: the intro cinematic now plays (bring-up: #726). - `guest_avplayer` and the other non-GPU tests pass (212). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!893
No description provided.