Fix a bug with engine nodes.

This bug results in an audio glitch when mixing nodes in the node
graph. It specifically happens when resampling is not being performed,
in which case it was specifying an output frame count greater than the
number of frames that are actually being output.

Public issue https://github.com/mackron/miniaudio/issues/408
This commit is contained in:
David Reid
2022-01-17 19:31:29 +10:00
parent f2d4fc426d
commit b2eccfa6d4
+2 -2
View File
@@ -70679,8 +70679,8 @@ static void ma_engine_node_process_pcm_frames__general(ma_engine_node* pEngineNo
framesJustProcessedIn = (ma_uint32)resampleFrameCountIn; framesJustProcessedIn = (ma_uint32)resampleFrameCountIn;
framesJustProcessedOut = (ma_uint32)resampleFrameCountOut; framesJustProcessedOut = (ma_uint32)resampleFrameCountOut;
} else { } else {
framesJustProcessedIn = framesAvailableIn; framesJustProcessedIn = ma_min(framesAvailableIn, framesAvailableOut);
framesJustProcessedOut = framesAvailableOut; framesJustProcessedOut = framesJustProcessedIn; /* When no resampling is being performed, the number of output frames is the same as input frames. */
} }
/* Fading. */ /* Fading. */