mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-23 17:13:13 -05:00
Add libogg 1.3.6 and libvorbis 1.3.7 as submodules, built from source as hidden static libraries, and implement the 31 libvorbisfile exports on top of them. Decoder state lives in a host table keyed by the guest OggVorbis_File, guest callbacks are trampolined, and vorbis_info is returned in its LP64 layout.
3.0 KiB
3.0 KiB
libSceVorbisDec technical debt
Unknown function info
- sceVorbisDecOpenCallbacks, sceVorbisDecRead and the other libvorbisfile exports (libSceVorbisDec) - the 31 exports named after libvorbisfile functions are taken to be the libvorbisfile API with a
sceVorbisDecprefix (Readisov_read,CrossLapisov_crosslap,HalfratePisov_halfrate_p).ReadFilter,ReadFloatandHalfrateexist in libvorbis (ov_read_filtersince 1.2.2, with the samevorbisfile.hsignatures through 1.3.7 apart fromconst) but not in Tremor, so times aredoubleandov_readtakesbigendianp,wordandsgned. Guestlongarguments and results are 64-bit. They run the bundled libvorbis 1.3.7 and libogg 1.3.6; the console's libvorbis version, any Sony changes to its behaviour or error codes, and the signatures themselves are unverified on a PS5. - sceVorbisDecGetDecodePriority (libSceVorbisDec) - declared without parameters, signature unknown; name from the NID database
- sceVorbisDecGetLastDecodeError (libSceVorbisDec) - declared without parameters, signature unknown; name from the NID database
- sceVorbisDecSetDecodePriority (libSceVorbisDec) - declared without parameters, signature unknown; name from the NID database
Functional
- libSceVorbisDec (libSceVorbisDec) - the guest
OggVorbis_Fileis never written: the decoder state lives on the host, keyed by the struct's address, so fields a title reads directly keep what it stored, and a struct never opened, cleared or failed to open behaves as libvorbisfile's zeroed struct.sceVorbisDecInforeturns a copy of each link'svorbis_infowith 64-bitlongfields, refreshed after every call on the struct and valid untilsceVorbisDecClear. Reopening a struct that is still open frees its old state without calling its close callback; libvorbisfile leaks it. - sceVorbisDecClear and sceVorbisDecCrossLap (libSceVorbisDec) - a null
vfthrows, as libvorbisfile dereferences it, except thatsceVorbisDecClearandsceVorbisDecCrossLapwith the same pointer twice return 0, andsceVorbisDecCrossLapwith a null second pointer after a first that is not open returnsOV_EINVAL, as libvorbisfile does.sceVorbisDecClearfrees the state before it calls the close callback, asov_cleardoes, so when that callback throws the struct is already cleared, where libvorbisfile leaves it freed but not zeroed. - sceVorbisDecOpenCallbacks and sceVorbisDecBitrate (libSceVorbisDec) - on Windows the host
longis 32-bit: a tell result outside it, or an initial byte count outside it with a non-nullinitial, throws; a sample rate of 2^31 Hz or more is rejected as a bad header; andsceVorbisDecBitraterounds halves up instead of to even.