Skip to content

fix(avplayer): defer loop warnings until frame delivery - #5846

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
SeifKaroui:fix/avplayer-loop-warning
Oct 15, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
SeifKaroui:fix/avplayer-loop-warning

Conversation

@SeifKaroui

Copy link
Copy Markdown
Contributor

What

With looping enabled, the demuxer can reach EOF and seek to the next pass while the caller is still receiving frames from the previous pass. Queuing SCE_AVPLAYER_ERROR_WAR_LOOPING_BACK there announces the loop before its first frame is delivered.

Record loop epochs during demuxing and queue one warning when either audio or video first delivers that epoch. Pending loop epochs are discarded on seek and restart. The callback remains asynchronous through the existing player event queue.

The regression uses the existing synthetic movie. This was investigated during ASTRONEER (PPSA27623, version 01.015.000) bring-up; the tests demonstrate callback ordering, and do not establish a title compatibility improvement. The delivery boundary follows KytyPS5; exact console callback timing remains unverified and is recorded in docs/dev/debt/libSceAvPlayer.md.

Open #1601 touches AvPlayer buffer retention in the same files. It does not implement this notification change, and this change has no implementation dependency on it.

Tested

Windows x64 25H2, build 26200.9457; WinLibs MinGW-w64 GCC 15.2.0 UCRT/POSIX/SEH; Release, BUILD_TESTING=ON. Base: upstream main at 5a6ad0ed36893e86022929b808ac547672445cd9.

  • guest_avplayer: three consecutive passes, 8.97-9.05 seconds each. Checks three video-only and audio-only wraps, exact warning counts, seek/restart handling, and one shared warning when both audio and video wrap. Existing playback, stream changes, pause, clock, frame lifetime and EOF checks also pass.
  • Unchanged upstream Source.cpp, rebuilt as a separate AvPlayer library and used with the new regression executable: exits 1 at loop warning did not match the playback boundary.
  • Fresh build of relinker, libs and patched_libraries_tests from the isolated checkout: passes.
  • Final ctest --test-dir build-pr-avplayer --output-on-failure -R "^(guest_avplayer|patched_libraries)$": 2/2 pass; playback 9.16 seconds, patched-library loading 0.82 seconds.
  • python tools/check_conventions.py --base upstream/main --title "fix(avplayer): defer loop warnings until frame delivery" --body <description>: passes for the contribution diff and PR description.

Not tested: Linux, console callback timing, or a title run with this isolated patch. No performance claim.

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
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a (AvPlayer change)
  • AI-assisted: yes (Codex)

Queue demux loop epochs and report each once when audio or video first delivers that pass. Discard pending loop boundaries on seek and restart. Add playback regressions and record unverified console callback timing.

AI-assisted: yes (Codex).
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1601 core/libs/prx/libSceAvPlayer/src/Source.cpp
core/libs/tests/GuestAvPlayer.cpp
PR 6044 core/libs/tests/GuestAvPlayer.cpp

@adriadam10 adriadam10 self-assigned this Oct 15, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on Linux: build + ctest of AvPlayer/libs (33 tests, all pass). Reverting only the Source.cpp change makes guest_avplayer fail, so the new regression tests exercise the fix: warning counts match the delivery boundary for video-only, audio-only, shared, and are dropped on seek/restart. Debt line is under the right section; merging once the full Build is green.

@adriadam10
adriadam10 merged commit 006388e into boykopovar:main Oct 15, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants