mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Create decodeTemp_ on demand. Fixes #20150
This commit is contained in:
parent
9f22d3a64e
commit
eb251af964
1 changed files with 3 additions and 6 deletions
|
@ -697,6 +697,9 @@ u32 Atrac2::DecodeInternal(u32 outbufAddr, int *SamplesNum, int *finish) {
|
|||
|
||||
_dbg_assert_(samplesToDecode <= info.SamplesPerFrame());
|
||||
if (samplesToDecode != info.SamplesPerFrame()) {
|
||||
if (!decodeTemp_) {
|
||||
decodeTemp_ = new int16_t[info.SamplesPerFrame() * outputChannels_];
|
||||
}
|
||||
outPtr = decodeTemp_;
|
||||
} else {
|
||||
outPtr = outbufAddr ? (int16_t *)Memory::GetPointer(outbufAddr) : 0; // outbufAddr can be 0 during skip!
|
||||
|
@ -846,12 +849,6 @@ int Atrac2::SetData(const Track &track, u32 bufferAddr, u32 readSize, u32 buffer
|
|||
info.loopEnd = 0;
|
||||
}
|
||||
|
||||
if (!decodeTemp_) {
|
||||
_dbg_assert_(track.channels <= 2);
|
||||
decodeTemp_ = new int16_t[track.SamplesPerFrame() * outputChannels + 1];
|
||||
decodeTemp_[track.SamplesPerFrame() * outputChannels] = 1337; // Sentinel
|
||||
}
|
||||
|
||||
context_->codec.inBuf = bufferAddr;
|
||||
|
||||
if (readSize > track.fileSize) {
|
||||
|
|
Loading…
Add table
Reference in a new issue