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
7ed2a284
Commit
7ed2a284
authored
Oct 29, 2017
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DirectSound] Try using exclusive mode when requested.
parent
0c5968f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
mini_al.h
mini_al.h
+8
-4
No files found.
mini_al.h
View file @
7ed2a284
...
...
@@ -2770,13 +2770,14 @@ mal_result mal_context_init__wasapi(mal_context* pContext)
(
void
)
pContext
;
#ifdef MAL_WIN32_DESKTOP
// WASAPI is only supported in Vista and newer.
// WASAPI is only supported in Vista SP1 and newer. The reason for SP1 and not the base version of Vista is that event-driven
// exclusive mode does not work until SP1.
OSVERSIONINFOEXW
osvi
;
mal_zero_object
(
&
osvi
);
osvi
.
dwOSVersionInfoSize
=
sizeof
(
osvi
);
osvi
.
dwMajorVersion
=
HIBYTE
(
_WIN32_WINNT_VISTA
);
osvi
.
dwMinorVersion
=
LOBYTE
(
_WIN32_WINNT_VISTA
);
osvi
.
wServicePackMajor
=
0
;
osvi
.
wServicePackMajor
=
1
;
if
(
VerifyVersionInfoW
(
&
osvi
,
VER_MAJORVERSION
|
VER_MINORVERSION
|
VER_SERVICEPACKMAJOR
,
VerSetConditionMask
(
VerSetConditionMask
(
VerSetConditionMask
(
0
,
VER_MAJORVERSION
,
VER_GREATER_EQUAL
),
VER_MINORVERSION
,
VER_GREATER_EQUAL
),
VER_SERVICEPACKMAJOR
,
VER_GREATER_EQUAL
)))
{
return
MAL_SUCCESS
;
}
else
{
...
...
@@ -3594,7 +3595,11 @@ static mal_result mal_device_init__dsound(mal_context* pContext, mal_device_type
}
// The cooperative level must be set before doing anything else.
if
(
FAILED
(
IDirectSound_SetCooperativeLevel
((
LPDIRECTSOUND8
)
pDevice
->
dsound
.
pPlayback
,
GetForegroundWindow
(),
DSSCL_PRIORITY
)))
{
HWND
hWnd
=
GetForegroundWindow
();
if
(
hWnd
==
NULL
)
{
hWnd
=
GetDesktopWindow
();
}
if
(
FAILED
(
IDirectSound_SetCooperativeLevel
((
LPDIRECTSOUND8
)
pDevice
->
dsound
.
pPlayback
,
hWnd
,
(
pConfig
->
preferExclusiveMode
)
?
DSSCL_EXCLUSIVE
:
DSSCL_PRIORITY
)))
{
mal_device_uninit__dsound
(
pDevice
);
return
mal_post_error
(
pDevice
,
"[DirectSound] IDirectSound_SetCooperateiveLevel() failed for playback device."
,
MAL_DSOUND_FAILED_TO_SET_COOP_LEVEL
);
}
...
...
@@ -9522,7 +9527,6 @@ void mal_pcm_f32_to_s32(int* pOut, const float* pIn, unsigned int count)
//
// WASAPI
// ------
// - Add support for exclusive mode?
// - Look into event callbacks: AUDCLNT_STREAMFLAGS_EVENTCALLBACK
//
//
...
...
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