mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-02-09 03:37:49 +03:00
Fixed CODEC_S16
This commit is contained in:
parent
8c3f57af1e
commit
db4b5e66c9
@ -1030,13 +1030,12 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisSta
|
|||||||
|
|
||||||
case CODEC_S16:
|
case CODEC_S16:
|
||||||
skipBytes = 0;
|
skipBytes = 0;
|
||||||
|
size_t bytesToRead;
|
||||||
numSamplesProcessed += numSamplesToLoadAdj;
|
numSamplesProcessed += numSamplesToLoadAdj;
|
||||||
dmemUncompressedAddrOffset1 = numSamplesToLoadAdj;
|
dmemUncompressedAddrOffset1 = numSamplesToLoadAdj;
|
||||||
size_t bytesToRead;
|
|
||||||
|
|
||||||
if (((synthState->samplePosInt * 2) + (numSamplesToLoadAdj + SAMPLES_PER_FRAME) * SAMPLE_SIZE) <
|
if (((synthState->samplePosInt * 2) + (numSamplesToLoadAdj)*SAMPLE_SIZE) < bookSample->size) {
|
||||||
bookSample->size) {
|
bytesToRead = (numSamplesToLoadAdj)*SAMPLE_SIZE;
|
||||||
bytesToRead = (numSamplesToLoadAdj + SAMPLES_PER_FRAME) * SAMPLE_SIZE;
|
|
||||||
} else {
|
} else {
|
||||||
bytesToRead = bookSample->size - (synthState->samplePosInt * 2);
|
bytesToRead = bookSample->size - (synthState->samplePosInt * 2);
|
||||||
}
|
}
|
||||||
@ -1052,8 +1051,15 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisSta
|
|||||||
}
|
}
|
||||||
|
|
||||||
aligned = ALIGN16((nFramesToDecode * frameSize) + 0x10);
|
aligned = ALIGN16((nFramesToDecode * frameSize) + 0x10);
|
||||||
addr = 0x990 - aligned;
|
addr = DMEM_COMPRESSED_ADPCM_DATA - aligned;
|
||||||
|
|
||||||
|
#if __SANITIZE_ADDRESS__
|
||||||
|
uintptr_t actualAddrLoaded = samplesToLoadAddr - sampleDataChunkAlignPad;
|
||||||
|
uintptr_t offset = actualAddrLoaded - (uintptr_t)sampleAddr;
|
||||||
|
if (offset + aligned > bookSample->size) {
|
||||||
|
aligned -= (offset + aligned - bookSample->size);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (nFramesToDecode != 0) {
|
if (nFramesToDecode != 0) {
|
||||||
if (1) {}
|
if (1) {}
|
||||||
frameIndex = (synthState->samplePosInt + skipInitialSamples - nFirstFrameSamplesToIgnore) / 16;
|
frameIndex = (synthState->samplePosInt + skipInitialSamples - nFirstFrameSamplesToIgnore) / 16;
|
||||||
|
Loading…
Reference in New Issue
Block a user