fix(avplayer): read the PS5 SceAvPlayerInitDataEx layout #2159
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2159"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Angel21PC on 2026-10-09T10:16:17Z.
What
PS5 titles pass a 0x230-byte
SceAvPlayerInitDataExtosceAvPlayerInitEx(this_size0x230). It matches the PS4 layout (AvPlayerInitDataEx) up todebug_level; then come:sceAvPlayerInitExread auto start and the buffer count at their PS4 offsets, 0xa8 and 0xa4. In the PS5 layout, 0xa8 is the video decoder thread priority and 0xa4 lies in the audio decoder block. A title that sets thread priorities therefore had its video started on its own, and its buffer count was ignored.With
this_size0x230 or more, both fields are now read at the PS5 offsets. Smaller structures are read as before, and the thread parameters are still ignored.Where the layout comes from:
this_size0x230, writes auto start 0 as a byte at 0x74, the nine thread blocks with priority 700 and its buffer count at 0x228, and starts playback itself withsceAvPlayerStart.Tested
Windows 11 Pro, Intel Core i7-12700K, NVIDIA GeForce RTX 4070, 32 GB, MinGW-w64 GCC 15.2.0.
guest_avplayer(core/libs/tests/GuestAvPlayer.cpp,TestPs5ExtendedInitLayout) builds a 0x230-byte structure with 3 video frame buffers at 0x228 and checks two cases:sceAvPlayerStart;Both cases check that 3 + 4 decode-ahead video buffers are allocated. The test fails on
main("ready event missing", because a thread parameter was read as auto start) and passes with this change.tools/check_conventions.py --base origin/mainpasses.Poppy Playtime: Chapter 4: the Mob Entertainment intro video plays instead of starting on its own and stopping at once.
Not tested: Linux.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)