mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-26 14:26:23 +02:00
Merge pull request #22265 from hrydgard/vaudio-mp3-sample-counts
sceVaudioChReserve: accept the MP3 frame sizes
This commit is contained in:
@@ -42,16 +42,19 @@ void __VaudioDoState(PointerWrap &p) {
|
||||
}
|
||||
|
||||
static u32 sceVaudioChReserve(int sampleCount, int freq, int format) {
|
||||
// The vaudio channel is pickier than the normal ones: only three sample counts, stereo only,
|
||||
// and the same set of sample rates the SRC channel takes.
|
||||
// The vaudio channel is pickier than the normal ones: a fixed set of sample counts, stereo
|
||||
// only, and the same set of sample rates the SRC channel takes. It tests
|
||||
// 256/576/1024/1152 and then 2048, returning 0x80000104, before it looks at the format at all.
|
||||
// 576 and 1152 are the MPEG-2/2.5 and MPEG-1 Layer III frame sizes, so leaving them out broke
|
||||
// games that feed MP3 frames straight to the vaudio channel.
|
||||
if (sampleCount != 256 && sampleCount != 576 && sampleCount != 1024 && sampleCount != 1152 && sampleCount != 2048) {
|
||||
ERROR_LOG(Log::sceAudio, "sceVaudioChReserve(%i, %i, %i) - invalid sample count", sampleCount, freq, format);
|
||||
return SCE_KERNEL_ERROR_INVALID_SIZE;
|
||||
}
|
||||
if (format != 2) {
|
||||
ERROR_LOG(Log::sceAudio, "sceVaudioChReserve(%i, %i, %i) - unexpected format", sampleCount, freq, format);
|
||||
return SCE_KERNEL_ERROR_INVALID_FORMAT;
|
||||
}
|
||||
if (sampleCount != 256 && sampleCount != 1024 && sampleCount != 2048) {
|
||||
ERROR_LOG(Log::sceAudio, "sceVaudioChReserve(%i, %i, %i) - invalid sample count", sampleCount, freq, format);
|
||||
return SCE_KERNEL_ERROR_INVALID_SIZE;
|
||||
}
|
||||
if (freq != 0 && !SRCFrequencyAllowed(freq)) {
|
||||
ERROR_LOG(Log::sceAudio, "sceVaudioChReserve(%i, %i, %i) - invalid frequency", sampleCount, freq, format);
|
||||
return SCE_ERROR_AUDIO_INVALID_FREQUENCY;
|
||||
|
||||
Reference in New Issue
Block a user