Don't unnecessarily apply clipping.

This commit is contained in:
David Reid
2026-02-20 17:23:42 +10:00
parent 0e2c0e1eac
commit 7700880b56
+5 -1
View File
@@ -20626,7 +20626,11 @@ static void ma_device__handle_data_callback(ma_device* pDevice, void* pFramesOut
}
}
if (!pDevice->noClip && pDevice->playback.format == ma_format_f32) {
/*
Clipping is only necessary when both the external and internal format is f32. For anything else samples
will be clipped naturally as part of format conversion.
*/
if (!pDevice->noClip && pDevice->playback.format == ma_format_f32 && pDevice->playback.internalFormat == ma_format_f32) {
ma_clip_samples_f32((float*)pFramesOut, (const float*)pFramesOut, frameCount * pDevice->playback.channels); /* Intentionally specifying the same pointer for both input and output for in-place processing. */
}
}