mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
OpenSL|ES: Explicitly fail for known unsupported formats.
This commit is contained in:
@@ -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)
|
|||||||
// 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.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user