test(avplayer): give the paused-jump restart test an event callback #5733

Merged
oneandonlydean merged 1 commit from upstream-pr/5733 into main 2026-10-14 08:59:11 +00:00
oneandonlydean commented 2026-10-14 08:26:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T08:26:15Z.


What

Fixes the intermittent guest_avplayer failure ("enable video failed") reported again in #2709 by @simonbronk on current main.

TestRestartAfterPausedJumpKeepsClockRunning (added with #4652) creates the player with InitData(nullptr), so the player starts the source by itself, and then calls sceAvPlayerEnableStream by hand. When auto-start runs first, EnableStream fails because the source is already started. Giving the test an event callback, as #2770 did for TestUnsyncedVideoKeepsUpWithAudio, turns auto-start off and removes the race. The fix is @simonbronk's, from #2709.

TestAutoStartKeepsStartedPlayback also creates the player without events, but it tests that race on purpose and handles both orders.

Tested

  • Linux (CachyOS, GCC 16.2.1), Release, BUILD_TESTING=ON: ctest -R guest_avplayer --repeat until-fail:30 passes 30 of 30.
  • Windows is covered by CI.

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 under Silent stubs in their library's technical debt file
  • 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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4855082749 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5733). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T08:26:15Z. --- ### What Fixes the intermittent `guest_avplayer` failure ("enable video failed") reported again in #2709 by @simonbronk on current `main`. `TestRestartAfterPausedJumpKeepsClockRunning` (added with #4652) creates the player with `InitData(nullptr)`, so the player starts the source by itself, and then calls `sceAvPlayerEnableStream` by hand. When auto-start runs first, `EnableStream` fails because the source is already started. Giving the test an event callback, as #2770 did for `TestUnsyncedVideoKeepsUpWithAudio`, turns auto-start off and removes the race. The fix is @simonbronk's, from #2709. `TestAutoStartKeepsStartedPlayback` also creates the player without events, but it tests that race on purpose and handles both orders. ### Tested - Linux (CachyOS, GCC 16.2.1), Release, `BUILD_TESTING=ON`: `ctest -R guest_avplayer --repeat until-fail:30` passes 30 of 30. - Windows is covered by CI. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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
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!5733
No description provided.