mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-26 19:46:19 +00:00
Merge pull request #5888 from raven02/patch-5
Delay thread for sceMp3Decode()
This commit is contained in:
commit
c0e13bf38d
@ -82,7 +82,7 @@ public:
|
||||
|
||||
static std::map<u32, Mp3Context *> mp3Map_old;
|
||||
static std::map<u32, AuCtx *> mp3Map;
|
||||
|
||||
static const int mp3DecodeDelay = 4000;
|
||||
|
||||
AuCtx *getMp3Ctx(u32 mp3) {
|
||||
if (mp3Map.find(mp3) == mp3Map.end())
|
||||
@ -145,8 +145,13 @@ int sceMp3Decode(u32 mp3, u32 outPcmPtr) {
|
||||
ERROR_LOG(ME, "%s: bad mp3 handle %08x", __FUNCTION__, mp3);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ctx->AuDecode(outPcmPtr);
|
||||
|
||||
int pcmBytes = ctx->AuDecode(outPcmPtr);
|
||||
if (!pcmBytes) {
|
||||
// decode data successfully, delay thread
|
||||
hleDelayResult(pcmBytes, "mp3 decode", mp3DecodeDelay);
|
||||
}
|
||||
return pcmBytes;
|
||||
}
|
||||
|
||||
int sceMp3ResetPlayPosition(u32 mp3) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user