# libSceAvPlayer technical debt ### Silent stubs - [libSceAvPlayer](../../../core/libs/prx/libSceAvPlayer/Export.cpp): `sceAvPlayerSetLogCallback` accepts a callback that is never called, as the player produces no log messages, and `sceAvPlayerSetAvailableBandwidth` has no effect, as it governs HLS sources, which `sceAvPlayerAddSource` does not implement; after a source is added it returns `OPERATION_FAILED`, as [prosper's reading of the module](https://github.com/mattias800/prosper/blob/8dcb5dfdb9997ede7c76783995010d6abd1222f8/prosper/src/hle/video/avplayer.cpp#L960-L972) describes. - [sceAvPlayerSetTrickSpeed](../../../core/libs/prx/libSceAvPlayer/src/Source.cpp) (libSceAvPlayer) with a negative speed runs the clock backwards but delivers no frames; when a forward speed is set again, playback resumes from the rewound time. With a source, a zero speed returns `INVALID_PARAMS` before the `OPERATION_FAILED` of a stopped, finished or failed player, the order AnyPS5 had before; that order is unmeasured. In [prosper's reading of the module](https://github.com/mattias800/prosper/blob/8dcb5dfdb9997ede7c76783995010d6abd1222f8/prosper/src/hle/video/avplayer.cpp#L929-L959), only the missing source is checked first. A zero speed is refused with `NOT_SUPPORTED`, with every other speed from -399 to 399 except 100, and no player state is checked. ### Unknown function info - [AvPlayer loop warnings](../../../core/libs/prx/libSceAvPlayer/src/Source.cpp) are queued when the first audio or video frame of a loop is delivered, following [KytyPS5's playback boundary tracking](https://github.com/KytyPS5/KytyPS5/blob/a6f4e8e7f456b8697d3102823d3f16400c3e121e/src/libs/avPlayer.cpp#L1038-L1043). The console's exact callback timing is unverified. Decode-ahead does not announce a loop while the caller is consuming the previous pass. - [sceAvPlayerAddSource](../../../core/libs/prx/libSceAvPlayer/src/Source.cpp) (libSceAvPlayer) - requests up to 4 additional decode-ahead video framebuffers from the memory replacement beyond `num_output_video_framebuffers` when memory is available; the console's internal buffering behaviour is unknown - [sceAvPlayerInit / sceAvPlayerInitEx](../../../core/libs/prx/libSceAvPlayer/src/Player.cpp) (libSceAvPlayer) - behaviour without a memory replacement unknown; frame and sample buffers then come from the guest heap. None of the six titles disassembled for this entry takes that path: PPSA01494, PPSA18194, PPSA21564, PPSA30839, PPSA31162 and PPSA36591 store all four allocator callbacks before each of their nine `sceAvPlayerInit` and `sceAvPlayerInitEx` calls. - [sceAvPlayerInitEx](../../../core/libs/prx/libSceAvPlayer/Export.cpp) (libSceAvPlayer) - the PS5 init data layout (`this_size` 0x230: auto start at 0x74, nine 0x30-byte thread parameter blocks from 0x78, output video frame buffer count at 0x228) follows [KytyPS5](https://github.com/KytyPS5/KytyPS5/blob/main/src/libs/avPlayer.cpp), [prosper](https://github.com/mattias800/prosper/blob/main/prosper/src/hle/video/avplayer.cpp), [SharpProspero](https://github.com/SvenGDK/SharpProspero/blob/main/src/SharpProspero/Interop/Media/AvPlayer.cs) and [sharpemu](https://github.com/sharpemu/sharpemu/blob/main/src/SharpEmu.Libs/AvPlayer/AvPlayerExports.cs), which agree on it. PPSA25063 fills the same fields, writes auto start 0 and starts playback with `sceAvPlayerStart`; a title that sets auto start has not been seen. A smaller `this_size` is read with the PS4 offsets. The thread parameters are ignored - [AvPlayer auto start](../../../core/libs/prx/libSceAvPlayer/src/Player.cpp) (libSceAvPlayer) - the auto start that `sceAvPlayerAddSource` queues for a player with auto start or without an event callback starts the player only while it is still ready: a title that starts the player itself before the auto start runs keeps its playback and the frames it holds. Not confirmed on a title. - [Paused initial video](../../../core/libs/prx/libSceAvPlayer/src/Source.cpp) (libSceAvPlayer) keeps the first picture available when audio has already established the playback epoch before the caller pauses. Further pictures of that epoch stay blocked, as after a paused jump. The console's exact initial preparation ordering has not been measured. - [AvPlayer frame aspect ratio](../../../core/libs/prx/libSceAvPlayer/src/Source.cpp) (libSceAvPlayer) - the `aspect_ratio` of the stream info is the stream's sample aspect ratio, and that of a video frame is the picture's sample aspect ratio, falling back to the stream's; both are 0.0 when no ratio is given. This follows [BunnyFl's reading of firmware 13.42](https://github.com/boykopovar/AnyPS5/pull/9937#issuecomment-6396994223) (emulator execution and code reading, H.264 only, no console run). AnyPS5 reads the ratio through FFmpeg, which does not tell an `aspect_ratio_idc` of 0 (1.0 on the console) from missing aspect information, nor apply the older mapping for titles built with an SDK below 6.00; HEVC and VP9 are unchecked. A title that sizes its video quad from the frame value drew it (9/16)^2 too small when it was width / height. ### Functional - [HTTP file sources](../../../core/libs/prx/libSceAvPlayer/src/HttpStream.cpp) remain unverified on PS5, and HLS remains unimplemented. Remote MP4/WebM inputs follow [SharpProspero's source types](https://github.com/SvenGDK/SharpProspero/blob/5dfdb4b0b166e83dc9ae275001afb695f12c7174/src/SharpProspero/Interop/Media/AvPlayer.cs#L187-L205); host HTTP byte ranges and redirects follow [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-range), framing [RFC 9112](https://www.rfc-editor.org/rfc/rfc9112.html#name-chunked-transfer-coding). Unsupported URL forms, TLS, encodings, proxy, cookie, authentication and console HTTP-context integration remain gaps in the [shared libSceHttp host client](libSceHttp.md#functional). - [HTTP source lifecycle](../../../core/libs/prx/libSceAvPlayer/src/HttpStream.cpp) still has no synchronous source-open deadline and cannot interrupt host DNS. Source opening waits for the shared client's initial response and known size, including full buffering of chunked, connection-close or ignored-range 200 responses. Stop cancels socket polling; failed reads use FFmpeg's existing demux-error path. Console timeout and network-error mapping remain unverified; transport validator and buffering limitations are listed in [libSceHttp](libSceHttp.md#functional). - [sceAvPlayerGetStreamInfo / sceAvPlayerGetStreamInfoEx](../../../core/libs/prx/libSceAvPlayer/src/Player.cpp) (libSceAvPlayer) - every player reports audio streams as type 2 (video 1), whether it was made by `sceAvPlayerInit` or by `sceAvPlayerInitEx` of any `this_size`. No module, SDK header or console measurement was used; the rule is inferred from titles. PPSA02433 makes its logo players with `sceAvPlayerInit` and its READY callback (app.elf 0x1509d50) enables type 2 as audio and type 1 as video and ignores other types, so type 0 left the logos silent; the PPSA02508 and PPSA03706 players made with the 0x230-byte `sceAvPlayerInitEx` layout enable type 2 as well. Unverified: whether the console library reports a different value for some init path or SDK version, and the values of other stream types (timed text). No title expecting audio type 0 is known - [sceAvPlayerGetVideoData / sceAvPlayerGetVideoDataEx](../../../core/libs/prx/libSceAvPlayer/src/Source.cpp) (libSceAvPlayer) - delivers a video frame up to 0.75 × frame duration ahead of its timestamp in default sync mode to accommodate presentation loops that poll slightly before the refresh boundary; the console's exact presentation tolerance is unverified. - [sceAvPlayerGetVideoData](../../../core/libs/prx/libSceAvPlayer/src/Source.cpp) (libSceAvPlayer) in sync mode `SCE_AVPLAYER_AV_SYNC_MODE_NONE` skips queued frames that the audio clock has already passed while the title pulls audio, so a title that requests video slower than the film's frame rate keeps the picture with the sound. Whether the console hands out every frame in this mode is unknown. PPSA12544 requests 7-19 frames per second for a 30 fps cinematic