/* Slow path. There's multiple output buses or channel conversion is required. We need to mix before outputting. pFramesOut is the accumulation buffer. */
/* Slow path. There's multiple output buses or channel conversion is required. We need to mix before outputting. pFramesOut is the accumulation buffer. */
/*
In order to reduce the amount of computation we'll be doing for volume control, we're going
to be smart about when we apply the volume. If we're increasing the number of channels,
we'll want to apply the volume factor before channel conversion. Otherwise we'll want to do
/* Input data is stored at the front of the buffer. */
/* Input data is stored at the front of the buffer. */
pBasePtr=pNodeBase->pCachedData;
pBasePtr=pNodeBase->pCachedData;
returnpBasePtr+(inputBusIndex*(pNodeBase->cachedDataCapInFramesPerBus*ma_node_get_output_channels(pNodeBase)));/* <-- Intentional use of output channel count here. Not a bug. */
ppFramesIn[iInputBus]=ma_node_get_cached_input_ptr(pNode,iInputBus)+(pNodeBase->consumedFrameCountIn*ma_node_get_output_channels(pNodeBase));/* This is the correct use of output channels. Not a bug. */
/* Adjust the volume of the splitter node's endpoints. We'll just do it 50/50 so that both of them combine to reproduce the original signal at the endpoint. */