Update the active source's direct and send properties after each mix

This commit is contained in:
Chris Robinson 2014-05-21 14:47:25 -07:00
parent f313ce2a96
commit 4a8d38c19a

View File

@ -356,14 +356,12 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
); );
if(!src->IsHrtf) if(!src->IsHrtf)
src->Dry.Mix(parms->OutBuffer, samples, &parms->Mix.Gains[chan], src->Dry.Mix(parms->OutBuffer, samples, &parms->Mix.Gains[chan],
maxu(parms->Counter, OutPos) - OutPos, OutPos, parms->Counter, OutPos, DstBufferSize);
DstBufferSize);
else else
src->Dry.HrtfMix( src->Dry.HrtfMix(
parms->OutBuffer, SrcData, maxu(parms->Counter, OutPos) - OutPos, parms->OutBuffer, SrcData, parms->Counter, parms->Offset,
parms->Offset + OutPos, OutPos, parms->Mix.Hrtf.IrSize, OutPos, parms->Mix.Hrtf.IrSize, &parms->Mix.Hrtf.Params[chan],
&parms->Mix.Hrtf.Params[chan], &parms->Mix.Hrtf.State[chan], &parms->Mix.Hrtf.State[chan], DstBufferSize
DstBufferSize
); );
} }
@ -381,8 +379,7 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
parms->Filters[chan].ActiveType parms->Filters[chan].ActiveType
); );
src->WetMix(parms->OutBuffer, samples, &parms->Gain, src->WetMix(parms->OutBuffer, samples, &parms->Gain,
maxu(parms->Counter, OutPos) - OutPos, parms->Counter, OutPos, DstBufferSize);
OutPos, DstBufferSize);
} }
} }
/* Update positions */ /* Update positions */
@ -393,6 +390,10 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
DataPosFrac &= FRACTIONMASK; DataPosFrac &= FRACTIONMASK;
} }
OutPos += DstBufferSize; OutPos += DstBufferSize;
src->Direct.Offset += DstBufferSize;
src->Direct.Counter = maxu(src->Direct.Counter, DstBufferSize) - DstBufferSize;
for(j = 0;j < Device->NumAuxSends;j++)
src->Send[j].Counter = maxu(src->Send[j].Counter, DstBufferSize) - DstBufferSize;
/* Handle looping sources */ /* Handle looping sources */
while(1) while(1)
@ -443,6 +444,4 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
Source->current_buffer = BufferListItem; Source->current_buffer = BufferListItem;
Source->position = DataPosInt; Source->position = DataPosInt;
Source->position_fraction = DataPosFrac; Source->position_fraction = DataPosFrac;
src->Direct.Offset += OutPos;
src->Direct.Counter = maxu(src->Direct.Counter, OutPos) - OutPos;
} }