Commit 8774f70d authored by David Reid's avatar David Reid

OpenSL|ES: Explicitly fail for known unsupported formats.

parent 6901b5ca
...@@ -3033,6 +3033,13 @@ static mal_result mal_device_init__sles(mal_device* pDevice, mal_device_type typ ...@@ -3033,6 +3033,13 @@ static mal_result mal_device_init__sles(mal_device* pDevice, mal_device_type typ
return MAL_NO_BACKEND; return MAL_NO_BACKEND;
#endif #endif
// Currently only supporting simple PCM formats. Floating-point and A-law/Mu-law are not
// currently supported, but may be emulated later on.
if (pConfig->format == mal_format_f32 || pConfig->format == mal_format_f64 ||
pConfig->format == mal_format_alaw || pConfig->format == mal_format_mulaw) {
return MAL_FORMAT_NOT_SUPPORTED;
}
// Initialize global data first if applicable. // Initialize global data first if applicable.
if (mal_atomic_increment_32(&g_malSLESInitCounter) == 1) { if (mal_atomic_increment_32(&g_malSLESInitCounter) == 1) {
SLresult resultSL = slCreateEngine(&g_malEngineObjectSL, 0, NULL, 0, NULL, NULL); SLresult resultSL = slCreateEngine(&g_malEngineObjectSL, 0, NULL, 0, NULL, NULL);
...@@ -3880,7 +3887,7 @@ mal_uint32 mal_get_sample_size_in_bytes(mal_format format) ...@@ -3880,7 +3887,7 @@ mal_uint32 mal_get_sample_size_in_bytes(mal_format format)
// OpenSL|ES / Android // OpenSL|ES / Android
// ------------------- // -------------------
// - Test! // - Test!
// - Add software f32 conversion // - Add software f32, f64, A-law and Mu-law conversion
// - 32-bit floating point formats are only supported from API Level 21. // - 32-bit floating point formats are only supported from API Level 21.
......
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