mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 09:14:04 +02:00
Don't unnecessarily apply clipping.
This commit is contained in:
+5
-1
@@ -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. */
|
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. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user