mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 23:40:39 +00:00
Clamp the final sample count during decode.
Some games depend on / expect this, or else they'll let important data get overwritten.
This commit is contained in:
parent
68f4a1e7f7
commit
fa42426d21
@ -676,6 +676,9 @@ u32 _AtracDecodeData(int atracID, u8 *outbuf, u32 outbufPtr, u32 *SamplesNum, u3
|
||||
skipSamples -= skipped;
|
||||
numSamples = atrac->pFrame->nb_samples - skipped;
|
||||
|
||||
// If we're at the end, clamp to samples we want. It always returns a full chunk.
|
||||
numSamples = std::min((u32)atrac->endSample - (u32)atrac->currentSample, numSamples);
|
||||
|
||||
if (skipped > 0 && numSamples == 0) {
|
||||
// Wait for the next one.
|
||||
got_frame = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user