Fix a mixing bug when applying an effect.

This commit is contained in:
David Reid
2020-08-16 11:32:07 +10:00
parent 96ee8242f4
commit 340dbcc37b
+2 -2
View File
@@ -1884,11 +1884,11 @@ static ma_result ma_volume_and_clip_and_effect_pcm_frames(void* pDst, ma_format
otherwise we need to convert.
*/
if (effectFormatOut == formatOut && effectChannelsOut == channelsOut) {
/* Fast path. No data conversion required for output data. Just accumulate. */
/* Fast path. No data conversion required for output data. Just accumulate or overwrite. */
if (isAccumulation) {
ma_unclipped_accumulate_pcm_frames(pRunningDst, effectBufferOut, effectFrameCountOut, effectFormatOut, effectChannelsOut);
} else {
ma_clipped_accumulate_pcm_frames(pRunningDst, effectBufferOut, effectFrameCountOut, effectFormatOut, effectChannelsOut);
ma_clip_pcm_frames(pRunningDst, effectBufferOut, effectFrameCountOut, effectFormatOut, effectChannelsOut);
}
} else {
/* Slow path. Data conversion required before accumulating. */