From 3e5e10d31acf7254a563583f6e6cdb79f65b08bc Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 4 Jul 2021 16:11:46 +1000 Subject: [PATCH] API CHANGE: Update ma_clip_pcm_frames_f32(). This now takes an input and output buffer rather than performing the clipping in-place. --- miniaudio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index 562eeb95..95e5ce59 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -5899,7 +5899,7 @@ static MA_INLINE const float* ma_offset_pcm_frames_const_ptr_f32(const float* p, Clips f32 samples. */ MA_API void ma_clip_samples_f32(float* pDst, const float* pSrc, ma_uint64 count); -static MA_INLINE void ma_clip_pcm_frames_f32(float* p, ma_uint64 frameCount, ma_uint32 channels) { ma_clip_samples_f32(p, p, frameCount*channels); } +static MA_INLINE void ma_clip_pcm_frames_f32(float* pDst, const float* pSrc, ma_uint64 frameCount, ma_uint32 channels) { ma_clip_samples_f32(pDst, pSrc, frameCount*channels); } /* Helper for applying a volume factor to samples. @@ -12165,7 +12165,7 @@ static void ma_device__on_data(ma_device* pDevice, void* pFramesOut, const void* } if (!pDevice->noClip && pDevice->playback.format == ma_format_f32) { - ma_clip_pcm_frames_f32((float*)pFramesOut, frameCount, pDevice->playback.channels); + ma_clip_pcm_frames_f32((float*)pFramesOut, (const float*)pFramesOut, frameCount, pDevice->playback.channels); /* Intentionally specifying the same pointer for both input and output for in-place processing. */ } } }