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
dd8f6c4c
Commit
dd8f6c4c
authored
Nov 08, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings on the Emscripten build.
parent
8451af8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
examples/custom_backend.c
examples/custom_backend.c
+5
-1
No files found.
examples/custom_backend.c
View file @
dd8f6c4c
...
...
@@ -3,7 +3,8 @@ This example show how a custom backend can be implemented.
This implements a full-featured SDL2 backend. It's intentionally built using the same paradigms as the built-in backends in order to make
it suitable as a solid basis for a custom implementation. The SDL2 backend can be disabled with MA_NO_SDL, exactly like the build-in
backends. It supports both runtime and compile-time linking and respects the MA_NO_RUNTIME_LINKING option. It also works on Emscripten.
backends. It supports both runtime and compile-time linking and respects the MA_NO_RUNTIME_LINKING option. It also works on Emscripten
which requires the `-s USE_SDL=2` option.
There may be times where you want to support more than one custom backend. This example has been designed to make it easy to plug-in extra
custom backends without needing to modify any of the base miniaudio initialization code. A custom context structure is declared called
...
...
@@ -231,10 +232,13 @@ static ma_result ma_context_enumerate_devices__sdl(ma_context* pContext, ma_enum
static
ma_result
ma_context_get_device_info__sdl
(
ma_context
*
pContext
,
ma_device_type
deviceType
,
const
ma_device_id
*
pDeviceID
,
ma_device_info
*
pDeviceInfo
)
{
ma_context_ex
*
pContextEx
=
(
ma_context_ex
*
)
pContext
;
#if !defined(__EMSCRIPTEN__)
MA_SDL_AudioSpec
desiredSpec
;
MA_SDL_AudioSpec
obtainedSpec
;
MA_SDL_AudioDeviceID
tempDeviceID
;
const
char
*
pDeviceName
;
#endif
MA_ASSERT
(
pContext
!=
NULL
);
...
...
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