Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
21e7c413
Commit
21e7c413
authored
Dec 12, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OpenSL: Add some extra logging to context initialization.
Public issue
https://github.com/mackron/miniaudio/issues/247
parent
8c56989e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
miniaudio.h
miniaudio.h
+13
-2
No files found.
miniaudio.h
View file @
21e7c413
...
@@ -31373,46 +31373,55 @@ static ma_result ma_context_init__opensl(const ma_context_config* pConfig, ma_co
...
@@ -31373,46 +31373,55 @@ 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;
}
}
...
@@ -31426,7 +31435,9 @@ static ma_result ma_context_init__opensl(const ma_context_config* pConfig, ma_co
...
@@ -31426,7 +31435,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;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment