mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-30 04:04:05 +02:00
API CHANGE: Update ma_noise_uninit().
This removes the allocations callback parameter. It is no managed internally in preparation for some changes to data source management.
This commit is contained in:
+7
-3
@@ -10807,6 +10807,7 @@ typedef struct
|
||||
{
|
||||
ma_data_source_base ds;
|
||||
ma_noise_config config;
|
||||
ma_allocation_callbacks allocationCallbacks;
|
||||
ma_lcg lcg;
|
||||
union
|
||||
{
|
||||
@@ -10830,7 +10831,7 @@ typedef struct
|
||||
MA_API ma_result ma_noise_get_heap_size(const ma_noise_config* pConfig, size_t* pHeapSizeInBytes);
|
||||
MA_API ma_result ma_noise_init_preallocated(const ma_noise_config* pConfig, void* pHeap, ma_noise* pNoise);
|
||||
MA_API ma_result ma_noise_init(const ma_noise_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_noise* pNoise);
|
||||
MA_API void ma_noise_uninit(ma_noise* pNoise, const ma_allocation_callbacks* pAllocationCallbacks);
|
||||
MA_API void ma_noise_uninit(ma_noise* pNoise);
|
||||
MA_API ma_result ma_noise_read_pcm_frames(ma_noise* pNoise, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead);
|
||||
MA_API ma_result ma_noise_set_amplitude(ma_noise* pNoise, double amplitude);
|
||||
MA_API ma_result ma_noise_set_seed(ma_noise* pNoise, ma_int32 seed);
|
||||
@@ -78184,6 +78185,7 @@ MA_API ma_result ma_noise_init_preallocated(const ma_noise_config* pConfig, void
|
||||
}
|
||||
|
||||
MA_ZERO_OBJECT(pNoise);
|
||||
pNoise->allocationCallbacks = ma_allocation_callbacks_init_default();
|
||||
|
||||
result = ma_noise_get_heap_layout(pConfig, &heapLayout);
|
||||
if (result != MA_SUCCESS) {
|
||||
@@ -78253,11 +78255,13 @@ MA_API ma_result ma_noise_init(const ma_noise_config* pConfig, const ma_allocati
|
||||
return result;
|
||||
}
|
||||
|
||||
ma_allocation_callbacks_init_copy(&pNoise->allocationCallbacks, pAllocationCallbacks);
|
||||
|
||||
pNoise->_ownsHeap = MA_TRUE;
|
||||
return MA_SUCCESS;
|
||||
}
|
||||
|
||||
MA_API void ma_noise_uninit(ma_noise* pNoise, const ma_allocation_callbacks* pAllocationCallbacks)
|
||||
MA_API void ma_noise_uninit(ma_noise* pNoise)
|
||||
{
|
||||
if (pNoise == NULL) {
|
||||
return;
|
||||
@@ -78266,7 +78270,7 @@ MA_API void ma_noise_uninit(ma_noise* pNoise, const ma_allocation_callbacks* pAl
|
||||
ma_data_source_base_uninit(&pNoise->ds);
|
||||
|
||||
if (pNoise->_ownsHeap) {
|
||||
ma_free(pNoise->_pHeap, pAllocationCallbacks);
|
||||
ma_free(pNoise->_pHeap, &pNoise->allocationCallbacks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -839,7 +839,7 @@ done:
|
||||
ma_waveform_uninit(&g_State.waveform);
|
||||
}
|
||||
if (g_State.sourceType == source_type_noise) {
|
||||
ma_noise_uninit(&g_State.noise, NULL);
|
||||
ma_noise_uninit(&g_State.noise);
|
||||
}
|
||||
if (g_State.hasEncoder) {
|
||||
ma_encoder_uninit(&g_State.encoder);
|
||||
|
||||
@@ -31,7 +31,7 @@ ma_result test_noise__by_format_and_type(ma_format format, ma_noise_type type, c
|
||||
}
|
||||
|
||||
ma_encoder_uninit(&encoder);
|
||||
ma_noise_uninit(&noise, NULL);
|
||||
ma_noise_uninit(&noise);
|
||||
return MA_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user