Commit bc23d565 authored by David Reid's avatar David Reid

Minor optimization to ma_copy_pcm_frames() and update to documentation.

This changes makes ma_copy_pcm_frames() a no-op when the input and
output buffers are both set to the same pointer. This is useful for
some in-place no-ops for effects and filters.
parent b287d94f
......@@ -7475,11 +7475,15 @@ static MA_INLINE ma_int32 ma_dither_s32(ma_dither_mode ditherMode, ma_int32 dith
}
/******************************************************************************
/**************************************************************************************************************************************************************
Atomics
******************************************************************************/
ma_atomic_increment/decrement_*() takes a pointer to the variable being incremented and returns the new value. Usage:
ma_uint32 newValue = ma_atomic_increment_32(&theValueToIncrement);
**************************************************************************************************************************************************************/
#if defined(__clang__)
#if defined(__has_builtin)
#if __has_builtin(__sync_swap)
......@@ -30791,6 +30795,10 @@ MA_API ma_uint32 ma_calculate_buffer_size_in_frames_from_milliseconds(ma_uint32
MA_API void ma_copy_pcm_frames(void* dst, const void* src, ma_uint64 frameCount, ma_format format, ma_uint32 channels)
{
if (dst == src) {
return; /* No-op. */
}
ma_copy_memory_64(dst, src, frameCount * ma_get_bytes_per_frame(format, channels));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment