Commit eb7ac83b authored by David Reid's avatar David Reid

Small tweaks to the SDL backend.

parent cea33534
...@@ -15042,11 +15042,12 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, mal ...@@ -15042,11 +15042,12 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, mal
fType = 2.0f; fType = 2.0f;
} }
// Backend tax. Need to fiddle with this. Special case for Emscripten. // Backend tax. Need to fiddle with this. Keep in mind that SDL always rounds the buffer size up to the next
// power of two which should cover the natural API overhead. Special case for Emscripten.
#if defined(__EMSCRIPTEN__) #if defined(__EMSCRIPTEN__)
float fBackend = 4.0f; float fBackend = 1.0f;
#else #else
float fBackend = 2.0f; float fBackend = 1.0f;
#endif #endif
bufferSize = mal_calculate_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate, fCPUSpeed*fType*fBackend); bufferSize = mal_calculate_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate, fCPUSpeed*fType*fBackend);
......
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