Fix audio crash in FF type-0

This commit is contained in:
raven02 2012-12-23 23:27:54 +08:00
parent 0d6cfab61b
commit c7a9c40827

View File

@ -215,7 +215,7 @@ void SasInstance::Mix(u32 outAddr) {
// Figure out number of samples to read.
int curSample = voice.samplePos / PSP_SAS_PITCH_BASE;
int lastSample = (voice.samplePos + grainSize * voice.pitch) / PSP_SAS_PITCH_BASE;
int numSamples = lastSample - curSample;
u32 numSamples = lastSample - curSample;
if (numSamples > grainSize * 4) {
ERROR_LOG(SAS, "numSamples too large, clamping: %i vs %i", numSamples, grainSize * 4);
numSamples = grainSize * 4;
@ -491,4 +491,4 @@ void ADSREnvelope::KeyOn() {
void ADSREnvelope::KeyOff() {
SetState(STATE_RELEASE);
height_ = sustainLevel;
}
}