Commit Graph
15 Commits
Author SHA1 Message Date
Leonardo Baldazzi 742aeb4211 fix(avplayer): preserve caller-paced delivery in no-sync mode 2026-10-16 22:35:36 +02:00
Leonardo Baldazzi bd9d10b4ce fix: correct audio-video playback timing and sync 2026-10-16 22:35:30 +02:00
Adrià e576db754f Merge pull request #5944 from Ondra97/codex/fix-avplayer-callback-close
fix(avplayer): close safely from event callbacks
2026-10-16 22:29:32 +02:00
Ondra97 5474b7756d fix(avplayer): close safely from event callbacks 2026-10-14 18:36:15 +02:00
Seif Allah Karoui 86de982f25 fix(avplayer): defer loop warnings until frame delivery
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).
2026-10-14 14:38:36 +01:00
xXPBSXxandClaude Sonnet 5.5 a671dc4edf fix(avplayer): resume the presentation clock when the source restarts after a pause
Clock::Reset left the paused flag set by Clock::Pause, so a Start issued
from the paused state (stop and restart of the source) kept the clock
frozen at the start position. Only the frame at that position was
delivered; later frames were held back by the default A/V sync.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 19:36:06 +02:00
Santhosh Kumar 17827dd9ab fix(filesystem): reject invalid parent traversal on Windows 2026-10-12 01:25:02 +05:30
Roojool 23b65eb553 fix(avplayer): use precise Windows notified waits for EOF polling
Waits on eventCondition go through libkernel's TimedWait::Condition (precise
timed waits on Windows) instead of std::condition_variable::wait_for, as
requested in review.
2026-10-11 11:20:24 +02:00
raghav314andClaude Opus 5.5 aa013f59ac fix(libc): register guest heap blocks without GPU access
AnyPS5's libc heap registered every block with GPU access, so every
address-based build imported or mirrored each malloc block the title had
made. The console's libc.prx maps its heap with protection 3 (CPU read
and write, no GPU bits), so the GPU never sees it there either.

Heap blocks are now registered without GPU access; reallocating keeps the
block's access. The AvPlayer fallback for a title that passes no texture
allocator stands in for that allocator, which hands out memory the GPU
reads, so it allocates through a new GuestHeapAlignForGpu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 07:02:30 +05:30
Yassine 9fc0af0b10 fix(avplayer): do not let auto start restart playback the title started
sceAvPlayerAddSource queues an auto start for a player created with auto
start or without an event callback. When the title enabled its streams
and called sceAvPlayerStart before the controller thread ran it, the auto
start called Start again on the playing player, which stopped it, released
every video buffer, including the frame the title held, and started the
film over. guest_avplayer occasionally caught this as "video frame is not
a texture allocation"; right after the test's own start, 8 texture
buffers were released in 15 of 15 runs.

The auto start now starts the player only while it is still ready, and
checks that under the player lock together with the start.

TestAutoStartKeepsStartedPlayback starts a callback-less player itself and
checks that no texture buffer is released afterwards and that the frame
it holds stays allocated. It fails on every run without the fix.
2026-10-10 17:56:25 +00:00
FaffuandClaude Opus 5.5 068da6a99f fix(avplayer): skip late video frames in no-sync mode while audio drives the clock
In SCE_AVPLAYER_AV_SYNC_MODE_NONE every decoded frame was handed out in
order, so a title that requests video slower than the film's frame rate
fell behind its audio (about 52 s by the end of the PPSA12544 intro).
While the title pulls audio, frames the audio clock has already passed are
now skipped; frames that are not late are handed out as before.

Fixes #1635

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 09:42:20 +02:00
MerijnandClaude Opus 5.5 736ba56d85 fix(avplayer): deliver the frame at a jump while paused
A paused player returned no video at all. Unity's video player prepares
a clip by starting it, pausing, jumping to the start and polling
sceAvPlayerGetVideoDataEx until the frame at the jump arrives, and only
then resumes; PPSA12544 waited there forever on a black screen in its
intro cinematic. While paused, the first frame after a jump is now
delivered (the paused clock rebased to it); other frames are still held
until the player resumes. The guest test pauses, jumps and expects that
one frame and nothing after it.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 15:20:51 +02:00
hamb3r cf10b5e609 fix(avplayer): make decode-ahead buffers optional 2026-10-05 04:58:00 +03:00
hamb3randsaulo benigno c2fa7fd97f fix(avplayer): add decode-ahead buffers for application video output
When an application requests only 2 video buffers and holds one during playback, decode-ahead frames allow the decoder to stay ahead and prevent stalls under SyncModeNone.

Co-Authored-By: saulo benigno <saulobenigno@gmail.com>
2026-10-05 03:10:07 +03:00
Dean Galvin b62d02c2af feat(avplayer): decode H.264 and AAC with FFmpeg
Replace the decoder-less AvPlayer with a player that demuxes MP4 sources
with FFmpeg (opened by path or through the title's file replacement),
decodes H.264 and AAC on their own threads, and hands out NV12 frames and
interleaved 16-bit PCM in buffers from the title's allocators, presented
on a media clock that audio drives when it is enabled.

Both libSceAvPlayer and libSceAvPlayer.native are built from the same
sources and link the shared ffmpeg target. The struct size checks stay,
next to the types in SceTypes.hpp. ChangeStream and GetStreamInfoEx are
implemented; Init without allocators, StartEx, SetAvailableBandwidth,
SetLogCallback and negative trick speeds succeed as before and are listed
in TechnicalDebt. HLS sources throw.

guest_avplayer plays an embedded 6 KB MP4 (H.264 plus two AAC tracks).
2026-10-03 08:10:55 +13:00