fix(ajm): refuse Opus rates other than 48 kHz and record the parameter layout as unknown

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pacuka
2026-10-04 14:28:19 +02:00
parent 5ecf80e2f5
commit 3e5648dcf7
2 changed files with 4 additions and 0 deletions
@@ -228,6 +228,9 @@ std::int32_t InitializeInstance(Instance& instance, const std::uint8_t* paramete
std::memcpy(&channels, parameters, sizeof(channels));
std::memcpy(&sampleRate, parameters + 4, sizeof(sampleRate));
if (channels == 0 || channels > 8 || sampleRate == 0) return AJM_RESULT_INVALID_PARAMETER;
std::uint32_t third = 0;
if (size >= 12) std::memcpy(&third, parameters + 8, sizeof(third));
if (sampleRate != 48000 || third != 0) NotImplemented_nid_no_patch("sceAjmBatchJobInitialize (Opus sample rate other than 48000 or nonzero third parameter word)");
instance.opusChannels = channels;
instance.opusSampleRate = sampleRate;
OpenOpus(instance);
+1
View File
@@ -48,6 +48,7 @@ Throughout the project, every function at every stage either **does exactly what
- [sceAvPlayerStartEx](../../core/libs/prx/libSceAvPlayer/Export.cpp) (libSceAvPlayer) - start info layout unknown; it is ignored and playback starts as with `sceAvPlayerStart`
- [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
- [SceAvPlayerVideoEx](../../core/libs/SceTypes.hpp) (libSceAvPlayer) - frame rate field and encoding unknown; it is left zero in frame and stream info
- [AJM Opus decoder](../../core/libs/prx/libSceAjm.native/src/Ajm.cpp) (libSceAjm.native, codec 24) - the initialize parameter layout (`u32 channels, u32 sample rate, u32`, seen as `2, 48000, 0`) and the little-endian `u16` byte count before each packet come from one title (The Smurfs Dreams); only 48000 Hz and a zero third word are accepted
### Functional