From f7fa0a06d484b4b7600277d2186f2f70ee22b723 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 24 Oct 2015 10:37:14 -0700 Subject: [PATCH] Atrac: Reset the fileoffset only when adding data. Otherwise, it's only a seek. For example, a seek to 0, as commonly seen. --- Core/HLE/sceAtrac.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index 0270f0b9d5..d8ee1567b3 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -1328,9 +1328,10 @@ static u32 sceAtracResetPlayPosition(int atracID, int sample, int bytesWrittenFi return ATRAC_ERROR_NO_DATA; } else { INFO_LOG(ME, "sceAtracResetPlayPosition(%i, %i, %i, %i)", atracID, sample, bytesWrittenFirstBuf, bytesWrittenSecondBuf); - atrac->first.fileoffset = atrac->getFileOffsetBySample(sample); - if (bytesWrittenFirstBuf > 0) + if (bytesWrittenFirstBuf > 0) { + atrac->first.fileoffset = atrac->getFileOffsetBySample(sample); sceAtracAddStreamData(atracID, bytesWrittenFirstBuf); + } #ifdef USE_FFMPEG if ((atrac->codecType == PSP_MODE_AT_3 || atrac->codecType == PSP_MODE_AT_3_PLUS) && atrac->pCodecCtx) { atrac->SeekToSample(sample);