Atrac: Correct remaining frame count for streaming.

This makes more sense, I think this is the right value.
This commit is contained in:
Unknown W. Brackets 2016-01-18 22:05:01 -08:00
parent 600df17eb6
commit 1b72d3a67a

View File

@ -374,11 +374,16 @@ struct Atrac {
// No longer looping in this case, outside the loop.
return PSP_ATRAC_NONLOOP_STREAM_DATA_IS_ON_MEMORY;
}
if ((bufferState_ & ATRAC_STATUS_STREAMED_MASK) == ATRAC_STATUS_STREAMED_MASK) {
if ((bufferState_ & ATRAC_STATUS_STREAMED_MASK) == ATRAC_STATUS_STREAMED_MASK && loopNum_ == 0) {
return PSP_ATRAC_LOOP_STREAM_DATA_IS_ON_MEMORY;
}
}
if ((bufferState_ & ATRAC_STATUS_STREAMED_MASK) == ATRAC_STATUS_STREAMED_MASK) {
// Since we're streaming, the remaining frames are what's valid in the buffer.
return bufferValidBytes_ / bytesPerFrame_;
}
// Since the first frame is shorter by this offset, add to round up at this offset.
const int remainingBytes = first_.fileoffset - currentFileOffset;
if (remainingBytes < 0) {