mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-15 23:40:29 +02:00
Mp3: Allow decode without pcm pointer.
Just like other audio decoding, you're allowed to skip audio. Also prevents a crash if the mp3 is not yet inited.
This commit is contained in:
1 parent
de5488d4df
commit
463fc3c792
2 files changed
+12
-10
No files matched your search
@@ -327,9 +327,8 @@ size_t AuCtx::FindNextMp3Sync() {
|
||||
|
||||
// return output pcm size, <0 error
|
||||
u32 AuCtx::AuDecode(u32 pcmAddr) {
|
||||
if (!Memory::IsValidAddress(pcmAddr)){
|
||||
ERROR_LOG(ME, "%s: output bufferAddress %08x is invalctx", __FUNCTION__, pcmAddr);
|
||||
return -1;
|
||||
if (!Memory::GetPointer(PCMBuf)) {
|
||||
return hleLogError(ME, -1, "ctx output bufferAddress %08x is invalid", PCMBuf);
|
||||
}
|
||||
|
||||
auto outbuf = Memory::GetPointer(PCMBuf);
|
||||
@@ -376,7 +375,8 @@ u32 AuCtx::AuDecode(u32 pcmAddr) {
|
||||
memset(outbuf + outpcmbufsize, 0, PCMBufSize - outpcmbufsize);
|
||||
}
|
||||
|
||||
Memory::Write_U32(PCMBuf, pcmAddr);
|
||||
if (pcmAddr)
|
||||
Memory::Write_U32(PCMBuf, pcmAddr);
|
||||
return outpcmbufsize;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user