mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Add closest_power_of_2 func and implement mix_rate/latency on OS X
This commit is contained in:
@@ -87,7 +87,7 @@ Error AudioDriverALSA::init() {
|
||||
CHECK_FAIL(status < 0);
|
||||
|
||||
int latency = GLOBAL_DEF("audio/output_latency", 25);
|
||||
buffer_size = nearest_power_of_2(latency * mix_rate / 1000);
|
||||
buffer_size = closest_power_of_2(latency * mix_rate / 1000);
|
||||
|
||||
// set buffer size from project settings
|
||||
status = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size);
|
||||
|
||||
Reference in New Issue
Block a user