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

This commit is contained in:
Henrik Rydgård committed 2025-03-19 10:42:32 +01:00
1 parent c5ad1548bc
commit da2b3fdd13
5 files changed
+6 -7

No files matched your search

+1 -1
View File
@@ -258,7 +258,7 @@ public:
u8 *BufferStart();
AtracStatus BufferState() const {
AtracStatus BufferState() const override {
return bufferState_;
}
+2 -4
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) {
+1 -1
View File
@@ -12,7 +12,7 @@ public:
delete[] decodeTemp_;
}
AtracStatus BufferState() const {
AtracStatus BufferState() const override {
return context_->info.state;
}
+2
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.
-1
View File
@@ -166,7 +166,6 @@ private:
int channels_ = 0;
int blockAlign_ = 0;
int srcPos_ = 0;
float *buffers_[2]{};
bool codecOpen_ = false;