Break apart the SetData function

This commit is contained in:
Henrik Rydgård 2025-03-11 19:38:38 +01:00
parent 8f66ebde90
commit 36fdb09056
2 changed files with 6 additions and 5 deletions

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 {

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);