mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
Version 0.10.28
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
|
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
|
||||||
miniaudio - v0.10.27 - 2020-12-04
|
miniaudio - v0.10.28 - 2020-12-16
|
||||||
|
|
||||||
David Reid - mackron@gmail.com
|
David Reid - mackron@gmail.com
|
||||||
|
|
||||||
@@ -3390,6 +3390,21 @@ static C89ATOMIC_INLINE double c89atomic_exchange_explicit_f64(volatile double*
|
|||||||
#define c89atomic_load_f64(ptr) c89atomic_load_explicit_f64(ptr, c89atomic_memory_order_seq_cst)
|
#define c89atomic_load_f64(ptr) c89atomic_load_explicit_f64(ptr, c89atomic_memory_order_seq_cst)
|
||||||
#define c89atomic_exchange_f32(dst, src) c89atomic_exchange_explicit_f32(dst, src, c89atomic_memory_order_seq_cst)
|
#define c89atomic_exchange_f32(dst, src) c89atomic_exchange_explicit_f32(dst, src, c89atomic_memory_order_seq_cst)
|
||||||
#define c89atomic_exchange_f64(dst, src) c89atomic_exchange_explicit_f64(dst, src, c89atomic_memory_order_seq_cst)
|
#define c89atomic_exchange_f64(dst, src) c89atomic_exchange_explicit_f64(dst, src, c89atomic_memory_order_seq_cst)
|
||||||
|
typedef c89atomic_flag c89atomic_spinlock;
|
||||||
|
static C89ATOMIC_INLINE void c89atomic_spinlock_lock(volatile c89atomic_spinlock* pSpinlock)
|
||||||
|
{
|
||||||
|
for (;;) {
|
||||||
|
if (c89atomic_flag_test_and_set_explicit(pSpinlock, c89atomic_memory_order_acquire) == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
while (c89atomic_load_explicit_8(pSpinlock, c89atomic_memory_order_relaxed) == 1) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static C89ATOMIC_INLINE void c89atomic_spinlock_unlock(volatile c89atomic_spinlock* pSpinlock)
|
||||||
|
{
|
||||||
|
c89atomic_flag_clear_explicit(pSpinlock, c89atomic_memory_order_release);
|
||||||
|
}
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -3830,8 +3845,6 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_attr_destroy(&attr);
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* It's the emscripten build. We'll have a few unused parameters. */
|
/* It's the emscripten build. We'll have a few unused parameters. */
|
||||||
@@ -3840,6 +3853,12 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
result = pthread_create(pThread, pAttr, entryProc, pData);
|
result = pthread_create(pThread, pAttr, entryProc, pData);
|
||||||
|
|
||||||
|
/* The thread attributes object is no longer required. */
|
||||||
|
if (pAttr != NULL) {
|
||||||
|
pthread_attr_destroy(pAttr);
|
||||||
|
}
|
||||||
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
return ma_result_from_errno(result);
|
return ma_result_from_errno(result);
|
||||||
}
|
}
|
||||||
@@ -4295,7 +4314,7 @@ not officially supporting this, but I'm leaving it here in case it's useful for
|
|||||||
|
|
||||||
/* Disable run-time linking on certain backends. */
|
/* Disable run-time linking on certain backends. */
|
||||||
#ifndef MA_NO_RUNTIME_LINKING
|
#ifndef MA_NO_RUNTIME_LINKING
|
||||||
#if defined(MA_ANDROID) || defined(MA_EMSCRIPTEN)
|
#if defined(MA_EMSCRIPTEN)
|
||||||
#define MA_NO_RUNTIME_LINKING
|
#define MA_NO_RUNTIME_LINKING
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -23295,20 +23314,23 @@ AAudio Backend
|
|||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
#ifdef MA_HAS_AAUDIO
|
#ifdef MA_HAS_AAUDIO
|
||||||
|
|
||||||
/*#include <AAudio/AAudio.h>*/
|
/*#include <AAudio/AAudio.h>*/
|
||||||
|
|
||||||
#define MA_AAUDIO_UNSPECIFIED 0
|
typedef int32_t ma_aaudio_result_t;
|
||||||
|
typedef int32_t ma_aaudio_direction_t;
|
||||||
|
typedef int32_t ma_aaudio_sharing_mode_t;
|
||||||
|
typedef int32_t ma_aaudio_format_t;
|
||||||
|
typedef int32_t ma_aaudio_stream_state_t;
|
||||||
|
typedef int32_t ma_aaudio_performance_mode_t;
|
||||||
|
typedef int32_t ma_aaudio_usage_t;
|
||||||
|
typedef int32_t ma_aaudio_content_type_t;
|
||||||
|
typedef int32_t ma_aaudio_input_preset_t;
|
||||||
|
typedef int32_t ma_aaudio_data_callback_result_t;
|
||||||
|
typedef struct ma_AAudioStreamBuilder_t* ma_AAudioStreamBuilder;
|
||||||
|
typedef struct ma_AAudioStream_t* ma_AAudioStream;
|
||||||
|
|
||||||
typedef int32_t ma_aaudio_result_t;
|
#define MA_AAUDIO_UNSPECIFIED 0
|
||||||
typedef int32_t ma_aaudio_direction_t;
|
|
||||||
typedef int32_t ma_aaudio_sharing_mode_t;
|
|
||||||
typedef int32_t ma_aaudio_format_t;
|
|
||||||
typedef int32_t ma_aaudio_stream_state_t;
|
|
||||||
typedef int32_t ma_aaudio_performance_mode_t;
|
|
||||||
typedef int32_t ma_aaudio_usage_t;
|
|
||||||
typedef int32_t ma_aaudio_content_type_t;
|
|
||||||
typedef int32_t ma_aaudio_input_preset_t;
|
|
||||||
typedef int32_t ma_aaudio_data_callback_result_t;
|
|
||||||
|
|
||||||
/* Result codes. miniaudio only cares about the success code. */
|
/* Result codes. miniaudio only cares about the success code. */
|
||||||
#define MA_AAUDIO_OK 0
|
#define MA_AAUDIO_OK 0
|
||||||
@@ -23382,9 +23404,6 @@ typedef int32_t ma_aaudio_data_callback_result_t;
|
|||||||
#define MA_AAUDIO_CALLBACK_RESULT_CONTINUE 0
|
#define MA_AAUDIO_CALLBACK_RESULT_CONTINUE 0
|
||||||
#define MA_AAUDIO_CALLBACK_RESULT_STOP 1
|
#define MA_AAUDIO_CALLBACK_RESULT_STOP 1
|
||||||
|
|
||||||
/* Objects. */
|
|
||||||
typedef struct ma_AAudioStreamBuilder_t* ma_AAudioStreamBuilder;
|
|
||||||
typedef struct ma_AAudioStream_t* ma_AAudioStream;
|
|
||||||
|
|
||||||
typedef ma_aaudio_data_callback_result_t (* ma_AAudioStream_dataCallback) (ma_AAudioStream* pStream, void* pUserData, void* pAudioData, int32_t numFrames);
|
typedef ma_aaudio_data_callback_result_t (* ma_AAudioStream_dataCallback) (ma_AAudioStream* pStream, void* pUserData, void* pAudioData, int32_t numFrames);
|
||||||
typedef void (* ma_AAudioStream_errorCallback)(ma_AAudioStream *pStream, void *pUserData, ma_aaudio_result_t error);
|
typedef void (* ma_AAudioStream_errorCallback)(ma_AAudioStream *pStream, void *pUserData, ma_aaudio_result_t error);
|
||||||
@@ -23994,10 +24013,10 @@ static ma_result ma_context_uninit__aaudio(ma_context* pContext)
|
|||||||
|
|
||||||
static ma_result ma_context_init__aaudio(const ma_context_config* pConfig, ma_context* pContext)
|
static ma_result ma_context_init__aaudio(const ma_context_config* pConfig, ma_context* pContext)
|
||||||
{
|
{
|
||||||
|
size_t i;
|
||||||
const char* libNames[] = {
|
const char* libNames[] = {
|
||||||
"libaaudio.so"
|
"libaaudio.so"
|
||||||
};
|
};
|
||||||
size_t i;
|
|
||||||
|
|
||||||
for (i = 0; i < ma_countof(libNames); ++i) {
|
for (i = 0; i < ma_countof(libNames); ++i) {
|
||||||
pContext->aaudio.hAAudio = ma_dlopen(pContext, libNames[i]);
|
pContext->aaudio.hAAudio = ma_dlopen(pContext, libNames[i]);
|
||||||
@@ -25173,15 +25192,19 @@ static ma_result ma_context_init_engine_nolock__opensl(ma_context* pContext)
|
|||||||
static ma_result ma_context_init__opensl(const ma_context_config* pConfig, ma_context* pContext)
|
static ma_result ma_context_init__opensl(const ma_context_config* pConfig, ma_context* pContext)
|
||||||
{
|
{
|
||||||
ma_result result;
|
ma_result result;
|
||||||
|
|
||||||
|
#if !defined(MA_NO_RUNTIME_LINKING)
|
||||||
size_t i;
|
size_t i;
|
||||||
const char* libOpenSLESNames[] = {
|
const char* libOpenSLESNames[] = {
|
||||||
"libOpenSLES.so"
|
"libOpenSLES.so"
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
MA_ASSERT(pContext != NULL);
|
MA_ASSERT(pContext != NULL);
|
||||||
|
|
||||||
(void)pConfig;
|
(void)pConfig;
|
||||||
|
|
||||||
|
#if !defined(MA_NO_RUNTIME_LINKING)
|
||||||
/*
|
/*
|
||||||
Dynamically link against libOpenSLES.so. I have now had multiple reports that SL_IID_ANDROIDSIMPLEBUFFERQUEUE cannot be found. One
|
Dynamically link against libOpenSLES.so. I have now had multiple reports that SL_IID_ANDROIDSIMPLEBUFFERQUEUE cannot be found. One
|
||||||
report was happening at compile time and another at runtime. To try working around this, I'm going to link to libOpenSLES at runtime
|
report was happening at compile time and another at runtime. To try working around this, I'm going to link to libOpenSLES at runtime
|
||||||
@@ -25196,49 +25219,68 @@ static ma_result ma_context_init__opensl(const ma_context_config* pConfig, ma_co
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pContext->opensl.libOpenSLES == NULL) {
|
if (pContext->opensl.libOpenSLES == NULL) {
|
||||||
return MA_NO_BACKEND; /* Couldn't find libOpenSLES.so */
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_INFO, "[OpenSL|ES] Could not find libOpenSLES.so");
|
||||||
|
return MA_NO_BACKEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_ENGINE", &pContext->opensl.SL_IID_ENGINE);
|
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_ENGINE", &pContext->opensl.SL_IID_ENGINE);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
|
ma_dlclose(pContext, pContext->opensl.libOpenSLES);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_AUDIOIODEVICECAPABILITIES", &pContext->opensl.SL_IID_AUDIOIODEVICECAPABILITIES);
|
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_AUDIOIODEVICECAPABILITIES", &pContext->opensl.SL_IID_AUDIOIODEVICECAPABILITIES);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
|
ma_dlclose(pContext, pContext->opensl.libOpenSLES);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_ANDROIDSIMPLEBUFFERQUEUE", &pContext->opensl.SL_IID_ANDROIDSIMPLEBUFFERQUEUE);
|
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_ANDROIDSIMPLEBUFFERQUEUE", &pContext->opensl.SL_IID_ANDROIDSIMPLEBUFFERQUEUE);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
|
ma_dlclose(pContext, pContext->opensl.libOpenSLES);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_RECORD", &pContext->opensl.SL_IID_RECORD);
|
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_RECORD", &pContext->opensl.SL_IID_RECORD);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
|
ma_dlclose(pContext, pContext->opensl.libOpenSLES);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_PLAY", &pContext->opensl.SL_IID_PLAY);
|
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_PLAY", &pContext->opensl.SL_IID_PLAY);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
|
ma_dlclose(pContext, pContext->opensl.libOpenSLES);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_OUTPUTMIX", &pContext->opensl.SL_IID_OUTPUTMIX);
|
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_OUTPUTMIX", &pContext->opensl.SL_IID_OUTPUTMIX);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
|
ma_dlclose(pContext, pContext->opensl.libOpenSLES);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_ANDROIDCONFIGURATION", &pContext->opensl.SL_IID_ANDROIDCONFIGURATION);
|
result = ma_dlsym_SLInterfaceID__opensl(pContext, "SL_IID_ANDROIDCONFIGURATION", &pContext->opensl.SL_IID_ANDROIDCONFIGURATION);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
|
ma_dlclose(pContext, pContext->opensl.libOpenSLES);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pContext->opensl.slCreateEngine = (ma_proc)ma_dlsym(pContext, pContext->opensl.libOpenSLES, "slCreateEngine");
|
pContext->opensl.slCreateEngine = (ma_proc)ma_dlsym(pContext, pContext->opensl.libOpenSLES, "slCreateEngine");
|
||||||
if (pContext->opensl.slCreateEngine == NULL) {
|
if (pContext->opensl.slCreateEngine == NULL) {
|
||||||
|
ma_dlclose(pContext, pContext->opensl.libOpenSLES);
|
||||||
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_INFO, "[OpenSL|ES] Cannot find symbol slCreateEngine.");
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_INFO, "[OpenSL|ES] Cannot find symbol slCreateEngine.");
|
||||||
return MA_NO_BACKEND;
|
return MA_NO_BACKEND;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
pContext->opensl.SL_IID_ENGINE = (ma_handle)SL_IID_ENGINE;
|
||||||
|
pContext->opensl.SL_IID_AUDIOIODEVICECAPABILITIES = (ma_handle)SL_IID_AUDIOIODEVICECAPABILITIES;
|
||||||
|
pContext->opensl.SL_IID_ANDROIDSIMPLEBUFFERQUEUE = (ma_handle)SL_IID_ANDROIDSIMPLEBUFFERQUEUE;
|
||||||
|
pContext->opensl.SL_IID_RECORD = (ma_handle)SL_IID_RECORD;
|
||||||
|
pContext->opensl.SL_IID_PLAY = (ma_handle)SL_IID_PLAY;
|
||||||
|
pContext->opensl.SL_IID_OUTPUTMIX = (ma_handle)SL_IID_OUTPUTMIX;
|
||||||
|
pContext->opensl.SL_IID_ANDROIDCONFIGURATION = (ma_handle)SL_IID_ANDROIDCONFIGURATION;
|
||||||
|
pContext->opensl.slCreateEngine = (ma_proc)slCreateEngine;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Initialize global data first if applicable. */
|
/* Initialize global data first if applicable. */
|
||||||
@@ -25249,7 +25291,9 @@ static ma_result ma_context_init__opensl(const ma_context_config* pConfig, ma_co
|
|||||||
ma_spinlock_unlock(&g_maOpenSLSpinlock);
|
ma_spinlock_unlock(&g_maOpenSLSpinlock);
|
||||||
|
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
return result; /* Failed to initialize the OpenSL engine. */
|
ma_dlclose(pContext, pContext->opensl.libOpenSLES);
|
||||||
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_INFO, "[OpenSL|ES] Failed to initialize OpenSL engine.");
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -26404,6 +26448,7 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pContext->callbacks.onContextInit != NULL) {
|
if (pContext->callbacks.onContextInit != NULL) {
|
||||||
|
ma_post_log_messagef(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize %s backend...", ma_get_backend_name(backend));
|
||||||
result = pContext->callbacks.onContextInit(pContext, pConfig, &pContext->callbacks);
|
result = pContext->callbacks.onContextInit(pContext, pConfig, &pContext->callbacks);
|
||||||
} else {
|
} else {
|
||||||
result = MA_NO_BACKEND;
|
result = MA_NO_BACKEND;
|
||||||
@@ -26431,12 +26476,14 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC
|
|||||||
#ifdef MA_HAS_ALSA
|
#ifdef MA_HAS_ALSA
|
||||||
case ma_backend_alsa:
|
case ma_backend_alsa:
|
||||||
{
|
{
|
||||||
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize ALSA backend...");
|
||||||
result = ma_context_init__alsa(pConfig, pContext);
|
result = ma_context_init__alsa(pConfig, pContext);
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef MA_HAS_PULSEAUDIO
|
#ifdef MA_HAS_PULSEAUDIO
|
||||||
case ma_backend_pulseaudio:
|
case ma_backend_pulseaudio:
|
||||||
{
|
{
|
||||||
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize PulseAudio backend...");
|
||||||
result = ma_context_init__pulse(pConfig, pContext);
|
result = ma_context_init__pulse(pConfig, pContext);
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
@@ -26449,36 +26496,42 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC
|
|||||||
#ifdef MA_HAS_COREAUDIO
|
#ifdef MA_HAS_COREAUDIO
|
||||||
case ma_backend_coreaudio:
|
case ma_backend_coreaudio:
|
||||||
{
|
{
|
||||||
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize CoreAudio backend...");
|
||||||
result = ma_context_init__coreaudio(pConfig, pContext);
|
result = ma_context_init__coreaudio(pConfig, pContext);
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef MA_HAS_SNDIO
|
#ifdef MA_HAS_SNDIO
|
||||||
case ma_backend_sndio:
|
case ma_backend_sndio:
|
||||||
{
|
{
|
||||||
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize sndio backend...");
|
||||||
result = ma_context_init__sndio(pConfig, pContext);
|
result = ma_context_init__sndio(pConfig, pContext);
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef MA_HAS_AUDIO4
|
#ifdef MA_HAS_AUDIO4
|
||||||
case ma_backend_audio4:
|
case ma_backend_audio4:
|
||||||
{
|
{
|
||||||
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize audio(4) backend...");
|
||||||
result = ma_context_init__audio4(pConfig, pContext);
|
result = ma_context_init__audio4(pConfig, pContext);
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef MA_HAS_OSS
|
#ifdef MA_HAS_OSS
|
||||||
case ma_backend_oss:
|
case ma_backend_oss:
|
||||||
{
|
{
|
||||||
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize OSS backend...");
|
||||||
result = ma_context_init__oss(pConfig, pContext);
|
result = ma_context_init__oss(pConfig, pContext);
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef MA_HAS_AAUDIO
|
#ifdef MA_HAS_AAUDIO
|
||||||
case ma_backend_aaudio:
|
case ma_backend_aaudio:
|
||||||
{
|
{
|
||||||
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize AAudio backend...");
|
||||||
result = ma_context_init__aaudio(pConfig, pContext);
|
result = ma_context_init__aaudio(pConfig, pContext);
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef MA_HAS_OPENSL
|
#ifdef MA_HAS_OPENSL
|
||||||
case ma_backend_opensl:
|
case ma_backend_opensl:
|
||||||
{
|
{
|
||||||
|
ma_post_log_message(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Attempting to initialize OpenSL backend...");
|
||||||
result = ma_context_init__opensl(pConfig, pContext);
|
result = ma_context_init__opensl(pConfig, pContext);
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
@@ -26526,6 +26579,8 @@ MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendC
|
|||||||
|
|
||||||
pContext->backend = backend;
|
pContext->backend = backend;
|
||||||
return result;
|
return result;
|
||||||
|
} else {
|
||||||
|
ma_post_log_messagef(pContext, NULL, MA_LOG_LEVEL_VERBOSE, "Failed to initialize %s backend.", ma_get_backend_name(backend));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
|
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
|
||||||
miniaudio - v0.10.27 - 2020-12-04
|
miniaudio - v0.10.28 - 2020-12-16
|
||||||
|
|
||||||
David Reid - mackron@gmail.com
|
David Reid - mackron@gmail.com
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define MA_VERSION_MAJOR 0
|
#define MA_VERSION_MAJOR 0
|
||||||
#define MA_VERSION_MINOR 10
|
#define MA_VERSION_MINOR 10
|
||||||
#define MA_VERSION_REVISION 27
|
#define MA_VERSION_REVISION 28
|
||||||
#define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION)
|
#define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION)
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(__clang__)
|
#if defined(_MSC_VER) && !defined(__clang__)
|
||||||
|
|||||||
+17
-11
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
|
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
|
||||||
miniaudio - v0.10.28 - TBD
|
miniaudio - v0.10.28 - 2020-12-16
|
||||||
|
|
||||||
David Reid - mackron@gmail.com
|
David Reid - mackron@gmail.com
|
||||||
|
|
||||||
@@ -9568,6 +9568,21 @@ static C89ATOMIC_INLINE double c89atomic_exchange_explicit_f64(volatile double*
|
|||||||
#define c89atomic_load_f64(ptr) c89atomic_load_explicit_f64(ptr, c89atomic_memory_order_seq_cst)
|
#define c89atomic_load_f64(ptr) c89atomic_load_explicit_f64(ptr, c89atomic_memory_order_seq_cst)
|
||||||
#define c89atomic_exchange_f32(dst, src) c89atomic_exchange_explicit_f32(dst, src, c89atomic_memory_order_seq_cst)
|
#define c89atomic_exchange_f32(dst, src) c89atomic_exchange_explicit_f32(dst, src, c89atomic_memory_order_seq_cst)
|
||||||
#define c89atomic_exchange_f64(dst, src) c89atomic_exchange_explicit_f64(dst, src, c89atomic_memory_order_seq_cst)
|
#define c89atomic_exchange_f64(dst, src) c89atomic_exchange_explicit_f64(dst, src, c89atomic_memory_order_seq_cst)
|
||||||
|
typedef c89atomic_flag c89atomic_spinlock;
|
||||||
|
static C89ATOMIC_INLINE void c89atomic_spinlock_lock(volatile c89atomic_spinlock* pSpinlock)
|
||||||
|
{
|
||||||
|
for (;;) {
|
||||||
|
if (c89atomic_flag_test_and_set_explicit(pSpinlock, c89atomic_memory_order_acquire) == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
while (c89atomic_load_explicit_8(pSpinlock, c89atomic_memory_order_relaxed) == 1) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static C89ATOMIC_INLINE void c89atomic_spinlock_unlock(volatile c89atomic_spinlock* pSpinlock)
|
||||||
|
{
|
||||||
|
c89atomic_flag_clear_explicit(pSpinlock, c89atomic_memory_order_release);
|
||||||
|
}
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -10539,15 +10554,6 @@ certain unused functions and variables can be excluded from the build to avoid w
|
|||||||
#endif
|
#endif
|
||||||
#ifdef MA_ENABLE_AAUDIO
|
#ifdef MA_ENABLE_AAUDIO
|
||||||
#define MA_HAS_AAUDIO
|
#define MA_HAS_AAUDIO
|
||||||
#if 0 /* Forcing runtime linking of AAudio for now. */
|
|
||||||
#ifdef MA_NO_RUNTIME_LINKING
|
|
||||||
#ifdef __has_include
|
|
||||||
#if !__has_include(<AAudio/AAudio.h>)
|
|
||||||
#undef MA_HAS_AAUDIO
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif /* 0 */
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef MA_ENABLE_OPENSL
|
#ifdef MA_ENABLE_OPENSL
|
||||||
#define MA_HAS_OPENSL
|
#define MA_HAS_OPENSL
|
||||||
@@ -64672,7 +64678,7 @@ The following miscellaneous changes have also been made.
|
|||||||
/*
|
/*
|
||||||
REVISION HISTORY
|
REVISION HISTORY
|
||||||
================
|
================
|
||||||
v0.10.28 - TBD
|
v0.10.28 - 2020-12-16
|
||||||
- Fix a crash when initializing a POSIX thread.
|
- Fix a crash when initializing a POSIX thread.
|
||||||
- OpenSL|ES: Respect the MA_NO_RUNTIME_LINKING option.
|
- OpenSL|ES: Respect the MA_NO_RUNTIME_LINKING option.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user