Warning fixes. Don't clamp readsize to reported file size.

This commit is contained in:
Henrik Rydgård 2025-03-19 10:42:09 +01:00
parent c5ad1548bc
commit da2b3fdd13
5 changed files with 6 additions and 7 deletions

View file

@ -258,7 +258,7 @@ public:
u8 *BufferStart();
AtracStatus BufferState() const {
AtracStatus BufferState() const override {
return bufferState_;
}

View file

@ -131,7 +131,7 @@ int Atrac2::RemainingFrames() const {
// Handle the easy cases first.
switch (info.state) {
case 0:
case ATRAC_STATUS_UNINITIALIZED:
case ATRAC_STATUS_NO_DATA:
return 0;
case ATRAC_STATUS_ALL_DATA_LOADED:
@ -838,9 +838,7 @@ int Atrac2::SetData(const Track &track, u32 bufferAddr, u32 readSize, u32 buffer
context_->codec.inBuf = bufferAddr;
if (readSize > track.fileSize) {
// This is seen in Tekken 6.
WARN_LOG(Log::ME, "readSize %d > track_.fileSize", readSize, track.fileSize);
readSize = track.fileSize;
INFO_LOG(Log::ME, "readSize (%d) > track_.fileSize (%d)", readSize, track.fileSize);
}
if (bufferSize >= track.fileSize) {

View file

@ -12,7 +12,7 @@ public:
delete[] decodeTemp_;
}
AtracStatus BufferState() const {
AtracStatus BufferState() const override {
return context_->info.state;
}

View file

@ -34,6 +34,8 @@ constexpr u32 ATRAC3PLUS_MAX_SAMPLES = 0x800; // 2048
// The "state" member of SceAtracIdInfo.
enum AtracStatus : u8 {
ATRAC_STATUS_UNINITIALIZED = 0, // bad state
ATRAC_STATUS_NO_DATA = 1,
// The entire file is loaded into memory, no further file access needed.

View file

@ -166,7 +166,6 @@ private:
int channels_ = 0;
int blockAlign_ = 0;
int srcPos_ = 0;
float *buffers_[2]{};
bool codecOpen_ = false;