Break apart the SetData function

This commit is contained in:
Henrik Rydgård committed 2025-03-18 09:36:33 +01:00
1 parent 8f66ebde90
commit 36fdb09056
2 files changed
+6 -5

No files matched your search

+5 -4
View File
@@ -546,9 +546,12 @@ int Atrac2::SetData(const Track &track, u32 bufferAddr, u32 readSize, u32 buffer
}
}
// Copied from the old implementation, let's see where they are useful.
int firstExtra = track_.FirstOffsetExtra();
InitContext(0, bufferAddr, readSize, bufferSize);
return 0;
}
void Atrac2::InitContext(int offset, u32 bufferAddr, u32 readSize, u32 bufferSize) {
SceAtracIdInfo &info = context_->info;
// Copy parameters into struct.
info.buffer = bufferAddr;
info.bufferByte = bufferSize;
@@ -606,8 +609,6 @@ int Atrac2::SetData(const Track &track, u32 bufferAddr, u32 readSize, u32 buffer
Memory::Memset(info.buffer, 0, 128);
}
}
return 0;
}
u32 Atrac2::GetInternalCodecError() const {
+1 -1
View File
@@ -56,7 +56,7 @@ public:
u32 GetInternalCodecError() const override;
private:
void SkipFramesAfterReset();
void InitContext(int offset, u32 bufferAddr, u32 readSize, u32 bufferSize);
void SeekToSample(int sample);