mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-25 19:30:53 +00:00
Atrac: correct offsetting logic in resetting.
Probably not super important exactly, but got the numbers backwards when I reduced the test data. Oops.
This commit is contained in:
parent
696cb6649e
commit
3afc86e9b8
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user