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
3405d9d5
Commit
3405d9d5
authored
Jul 11, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: Fail context init when PA is unusable.
parent
37d6bb6a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
mini_al.h
mini_al.h
+27
-1
No files found.
mini_al.h
View file @
3405d9d5
...
@@ -11337,7 +11337,6 @@ done:
...
@@ -11337,7 +11337,6 @@ done:
return result;
return result;
}
}
mal_result mal_context_init__pulse(mal_context* pContext)
mal_result mal_context_init__pulse(mal_context* pContext)
{
{
mal_assert(pContext != NULL);
mal_assert(pContext != NULL);
...
@@ -11489,6 +11488,33 @@ mal_result mal_context_init__pulse(mal_context* pContext)
...
@@ -11489,6 +11488,33 @@ mal_result mal_context_init__pulse(mal_context* pContext)
pContext->onEnumDevices = mal_context_enumerate_devices__pulse;
pContext->onEnumDevices = mal_context_enumerate_devices__pulse;
pContext->onGetDeviceInfo = mal_context_get_device_info__pulse;
pContext->onGetDeviceInfo = mal_context_get_device_info__pulse;
// Although we have found the libpulse library, it doesn't necessarily mean PulseAudio is useable. We need to initialize
// and connect a dummy PulseAudio context to test PulseAudio's usability.
mal_pa_mainloop* pMainLoop = ((mal_pa_mainloop_new_proc)pContext->pulse.pa_mainloop_new)();
if (pMainLoop == NULL) {
return MAL_NO_BACKEND;
}
mal_pa_mainloop_api* pAPI = ((mal_pa_mainloop_get_api_proc)pContext->pulse.pa_mainloop_get_api)(pMainLoop);
if (pAPI == NULL) {
((mal_pa_mainloop_free_proc)pContext->pulse.pa_mainloop_free)(pMainLoop);
return MAL_NO_BACKEND;
}
mal_pa_context* pPulseContext = ((mal_pa_context_new_proc)pContext->pulse.pa_context_new)(pAPI, pContext->config.pulse.pApplicationName);
if (pPulseContext == NULL) {
((mal_pa_mainloop_free_proc)pContext->pulse.pa_mainloop_free)(pMainLoop);
return MAL_NO_BACKEND;
}
int error = ((mal_pa_context_connect_proc)pContext->pulse.pa_context_connect)(pPulseContext, pContext->config.pulse.pServerName, 0, NULL);
if (error != MAL_PA_OK) {
((mal_pa_context_unref_proc)pContext->pulse.pa_context_unref)(pPulseContext);
((mal_pa_mainloop_free_proc)pContext->pulse.pa_mainloop_free)(pMainLoop);
return MAL_NO_BACKEND;
}
return MAL_SUCCESS;
return MAL_SUCCESS;
}
}
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