Fix a node graph error.

Prior to this commit, the number of frames read was always reported as
the whole frame count. This is incorrect for leaf nodes which don't
always produce the full frame count (an example being when the end of a
sound is reached).
This commit is contained in:
David Reid
2026-05-28 08:37:16 +10:00
parent a55d2e7eb8
commit 4679631f5b
+7 -2
View File
@@ -83596,6 +83596,7 @@ static ma_result ma_node_input_bus_read_pcm_frames(ma_node* pInputNode, ma_node_
ma_node_output_bus* pFirst;
ma_uint32 inputChannels;
ma_bool32 doesOutputBufferHaveContent = MA_FALSE;
ma_uint32 framesRead = 0;
/*
This will be called from the audio thread which means we can't be doing any locking. Basically,
@@ -83712,6 +83713,11 @@ static ma_result ma_node_input_bus_read_pcm_frames(ma_node* pInputNode, ma_node_
/* Seek. */
ma_node_read_pcm_frames(pOutputBus->pNode, pOutputBus->outputBusIndex, NULL, frameCount, &framesProcessed, globalTime);
}
/* The number of frames read will equal the maximum number of frames that were pulled from the outputs that are attached to this input. */
if (framesRead < framesProcessed) {
framesRead = framesProcessed;
}
}
/* If we didn't output anything, output silence. */
@@ -83719,8 +83725,7 @@ static ma_result ma_node_input_bus_read_pcm_frames(ma_node* pInputNode, ma_node_
ma_silence_pcm_frames(pFramesOut, frameCount, ma_format_f32, inputChannels);
}
/* In this path we always "process" the entire amount. */
*pFramesRead = frameCount;
*pFramesRead = framesRead;
return result;
}