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
47cc9319
Commit
47cc9319
authored
Dec 29, 2016
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Miscellaneous work on the OpenAL backend.
parent
629b37bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
mini_al.h
mini_al.h
+25
-1
No files found.
mini_al.h
View file @
47cc9319
...
...
@@ -4121,6 +4121,11 @@ typedef mal_ALCvoid mal_ALvoid;
#define MAL_ALC_CAPTURE_DEVICE_SPECIFIER 0x310
#define MAL_ALC_CAPTURE_SAMPLES 0x312
#define MAL_AL_SOURCE_STATE 0x1010
#define MAL_AL_INITIAL 0x1011
#define MAL_AL_PLAYING 0x1012
#define MAL_AL_PAUSED 0x1013
#define MAL_AL_STOPPED 0x1014
#define MAL_AL_FORMAT_MONO8 0x1100
#define MAL_AL_FORMAT_MONO16 0x1101
#define MAL_AL_FORMAT_STEREO8 0x1102
...
...
@@ -4220,7 +4225,7 @@ mal_result mal_context_init__openal(mal_context* pContext)
"libopenal.so"
;
#endif
#ifdef MAL_APPLE
// I don't own a Mac so a contribution here would be much appreciated!
// I don't own a Mac so a contribution here would be much appreciated!
Just don't know what the library is called...
#endif
pContext
->
openal
.
hOpenAL
=
mal_dlopen
(
libName
);
...
...
@@ -4395,6 +4400,11 @@ static mal_result mal_device_init__openal(mal_context* pContext, mal_device_type
pDevice
->
periods
=
MAL_MAX_PERIODS_OPENAL
;
}
// OpenAL has bad latency in my testing :(
if
(
pDevice
->
flags
&
MAL_DEVICE_FLAG_USING_DEFAULT_BUFFER_SIZE
)
{
pDevice
->
bufferSizeInFrames
*=
4
;
}
mal_ALCsizei
bufferSizeInSamplesAL
=
pConfig
->
bufferSizeInFrames
;
mal_ALCuint
frequencyAL
=
pConfig
->
sampleRate
;
...
...
@@ -4622,6 +4632,15 @@ static mal_result mal_device__main_loop__openal(mal_device* pDevice)
framesAvailable
-=
framesToRead
;
}
// There's a chance the source has stopped playing due to there not being any buffer's queue. Make sure it's restarted.
mal_ALenum
state
;
((
MAL_LPALGETSOURCEI
)
pDevice
->
pContext
->
openal
.
alGetSourcei
)(
pDevice
->
openal
.
sourceAL
,
MAL_AL_SOURCE_STATE
,
&
state
);
if
(
state
!=
MAL_AL_PLAYING
)
{
((
MAL_LPALSOURCEPLAY
)
pDevice
->
pContext
->
openal
.
alSourcePlay
)(
pDevice
->
openal
.
sourceAL
);
}
}
else
{
while
(
framesAvailable
>
0
)
{
mal_uint32
framesToSend
=
(
framesAvailable
>
pDevice
->
openal
.
subBufferSizeInFrames
)
?
pDevice
->
openal
.
subBufferSizeInFrames
:
framesAvailable
;
...
...
@@ -5224,6 +5243,11 @@ void mal_device_uninit(mal_device* pDevice)
mal_device_uninit__sles
(
pDevice
);
}
#endif
#ifdef MAL_ENABLE_OPENAL
if
(
pDevice
->
pContext
->
backend
==
mal_backend_openal
)
{
mal_device_uninit__openal
(
pDevice
);
}
#endif
#ifdef MAL_ENABLE_NULL
if
(
pDevice
->
pContext
->
backend
==
mal_backend_null
)
{
mal_device_uninit__null
(
pDevice
);
...
...
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