mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-11 08:39:28 +01:00
Merge pull request #8185 from unknownbrackets/atrac-resetting
Atrac: correct offsetting logic in resetting
This commit is contained in:
commit
255513c250
1 file changed
+4
-4
@@ -1120,15 +1120,15 @@ static void AtracGetResetBufferInfo(Atrac *atrac, AtracResetBufferInfo *bufferIn
|
||||
|
||||
bufferInfo->first.writePosPtr = atrac->first.addr;
|
||||
bufferInfo->first.writableBytes = std::min(atrac->first.filesize - sampleFileOffset, bufSizeAligned);
|
||||
if (((sample + atrac->firstSampleoffset) % atracSamplesPerFrame) > needsMoreFrames) {
|
||||
if (((sample + atrac->firstSampleoffset) % atracSamplesPerFrame) >= atracSamplesPerFrame - needsMoreFrames) {
|
||||
// Not clear why, but it seems it wants a bit extra in case the sample is late?
|
||||
bufferInfo->first.minWriteBytes = atrac->atracBytesPerFrame * 3;
|
||||
if ((u32)sample < (u32)atrac->firstSampleoffset) {
|
||||
sampleFileOffset -= atrac->atracBytesPerFrame;
|
||||
}
|
||||
} else {
|
||||
bufferInfo->first.minWriteBytes = atrac->atracBytesPerFrame * 2;
|
||||
}
|
||||
if ((u32)sample < (u32)atrac->firstSampleoffset && sampleFileOffset != atrac->dataOff) {
|
||||
sampleFileOffset -= atrac->atracBytesPerFrame;
|
||||
}
|
||||
bufferInfo->first.filePos = sampleFileOffset;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user