Skip to content

fix(avplayer): deliver the first paused picture after audio starts - #7680

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
gohansharma79-svg:codex/avplayer-paused-preview-20261019
Oct 20, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
gohansharma79-svg:codex/avplayer-paused-preview-20261019

Conversation

@gohansharma79-svg

@gohansharma79-svg gohansharma79-svg commented Oct 18, 2026 •

Copy link
Copy Markdown

What

Allow the first video picture to be returned while playback is paused after audio has already established the playback epoch. Previously takeVideo rejected that picture solely because its epoch was not newer than the audio clock, leaving a caller that prepares video this way with no picture. Once a picture has been presented, the existing paused-frame restriction still applies.

Ported from a local Lost Crown bring-up fix, with a standalone synthetic movie regression for both default and no-sync modes. No title-specific paths or IDs are introduced. This does not change the no-sync playback clock policy or claim an FPS gain. The console's exact initial preparation ordering has not been measured; this limitation is recorded in the AvPlayer technical debt.

Tested

Windows x64, GCC 15.2.0 / MinGW, Release. The current-main AvPlayer sources and regression executable were compiled in an external CMake validation harness using the existing FFmpeg static build and existing libc/kernel dependency artifacts; this is not a complete clean build of all upstream targets. No game files are included.

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

  • Fixes: none

  • Unblocks: none; synthetic regression, no claim of unblocking a complete title

  • GPUs tested: n/a (AvPlayer CPU decoding/state change)

  • AI-assisted: yes

@gohansharma79-svg
gohansharma79-svg marked this pull request as ready for review October 18, 2026 22:25
@github-actions

github-actions Bot commented Oct 18, 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/prx/libSceAvPlayer/CMakeLists.txt
core/libs/tests/GuestAvPlayer.cpp
PR 7412 core/libs/prx/libSceAvPlayer/src/Source.cpp
docs/dev/debt/libSceAvPlayer.md

@karimibrahim07 karimibrahim07 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows run of head a7ab0a0b9 in a full in-tree build, since the description lists that as not done. Merged onto main ccbd40240 together with #7669, #7670, #7709 and #7717 (each merge clean, built once). Windows 11 Pro (26300), Ryzen 5 3600, WinLibs GCC 15.2.0 r7, Ninja Release, BUILD_TESTING=ON.

  • guest_avplayer, guest_avplayer_callback_close and the new guest_avplayer_paused_first_video pass, --repeat until-fail:3.
  • Negative control: with main's Source.cpp the new test fails with first video frame blocked during paused preparation after audio started.

Code: presented is reset only in the start path (with clockEpoch = 0) and is set when a picture is handed out. So the new condition only lets one picture through while paused, before the first one since sceAvPlayerStart. After a paused jump presented is still true and the old rule applies, which TestRestartAfterPausedJumpKeepsClockRunning covers. The test's last check, that no second picture comes while paused, pins that down. I have no requests.

Not checked: Linux, and a title (I don't have The Lost Crown).

AI-assisted: yes. I ran the build, the tests and the negative control above.

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the presented guard in takeVideo (only reset at start, so the paused-jump block is unchanged), the new test's registration (working dir, Windows PATH) and the debt note, against current main. Windows run and negative control by @karimibrahim07 cover the test; merged.

@gohansharma79-svg

Copy link
Copy Markdown
Author

I have one more pull request

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.

3 participants