mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Mp3: Properly flush the buffer on reset.
This commit is contained in:
parent
4b4c0f9bda
commit
bfa9aa009d
@ -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) {
|
||||
|
@ -481,6 +481,9 @@ u32 AuCtx::AuResetPlayPositionByFrame(int position) {
|
||||
|
||||
u32 AuCtx::AuResetPlayPosition() {
|
||||
readPos = startPos;
|
||||
SumDecodedSamples = 0;
|
||||
AuBufAvailable = 0;
|
||||
sourcebuff.clear();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user