diff --git a/Core/HLE/sceMp3.cpp b/Core/HLE/sceMp3.cpp index 07a5e78cf0..56d5c0838a 100644 --- a/Core/HLE/sceMp3.cpp +++ b/Core/HLE/sceMp3.cpp @@ -171,15 +171,16 @@ static int sceMp3Decode(u32 mp3, u32 outPcmPtr) { } static int sceMp3ResetPlayPosition(u32 mp3) { - DEBUG_LOG(ME, "SceMp3ResetPlayPosition(%08x)", mp3); - AuCtx *ctx = getMp3Ctx(mp3); if (!ctx) { - ERROR_LOG(ME, "%s: bad mp3 handle %08x", __FUNCTION__, mp3); - return -1; + if (mp3 >= MP3_MAX_HANDLES) + return hleLogError(ME, ERROR_MP3_INVALID_HANDLE, "invalid handle"); + return hleLogError(ME, ERROR_MP3_NOT_YET_INIT_HANDLE, "unreserved handle"); + } else if (ctx->Version < 0 || ctx->AuBuf == 0) { + return hleLogError(ME, ERROR_MP3_NOT_YET_INIT_HANDLE, "not yet init"); } - return ctx->AuResetPlayPosition(); + return hleLogSuccessI(ME, ctx->AuResetPlayPosition()); } static int sceMp3CheckStreamDataNeeded(u32 mp3) { diff --git a/Core/HW/SimpleAudioDec.cpp b/Core/HW/SimpleAudioDec.cpp index 29124871da..ae1715a6ae 100644 --- a/Core/HW/SimpleAudioDec.cpp +++ b/Core/HW/SimpleAudioDec.cpp @@ -481,6 +481,9 @@ u32 AuCtx::AuResetPlayPositionByFrame(int position) { u32 AuCtx::AuResetPlayPosition() { readPos = startPos; + SumDecodedSamples = 0; + AuBufAvailable = 0; + sourcebuff.clear(); return 0; }