Improve remainFrame in sceAtrac

This commit is contained in:
oioitff 2013-05-06 04:02:16 +08:00
parent ded8bb3e9d
commit 0d2fbeff9c

View File

@ -161,12 +161,10 @@ struct Atrac {
int remainFrame;
if (first.fileoffset >= first.filesize || currentSample >= endSample)
remainFrame = PSP_ATRAC_ALLDATA_IS_ON_MEMORY;
else if (decodePos >= first.fileoffset - atracBytesPerFrame ) {
// require more data
remainFrame = PSP_ATRAC_ALLDATA_IS_ON_MEMORY;
} else {
// Games expect to be told how many frames need to be read.
remainFrame = (first.size - decodePos) / atracBytesPerFrame;
else {
// guess the remain frames.
// games would add atrac data when remainFrame = 0 or -1
remainFrame = (first.size - decodePos) / atracBytesPerFrame - 1;
}
return remainFrame;
}