Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
49078e00
Commit
49078e00
authored
Jul 06, 2016
by
Andrew Eikum
Committed by
Alexandre Julliard
Jul 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xaudio2: Always set current OpenAL context before making AL calls.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d72d6403
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
xaudio_dll.c
dlls/xaudio2_7/xaudio_dll.c
+19
-6
No files found.
dlls/xaudio2_7/xaudio_dll.c
View file @
49078e00
...
...
@@ -36,6 +36,7 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
static
ALCdevice
*
(
ALC_APIENTRY
*
palcLoopbackOpenDeviceSOFT
)(
const
ALCchar
*
);
static
void
(
ALC_APIENTRY
*
palcRenderSamplesSOFT
)(
ALCdevice
*
,
ALCvoid
*
,
ALCsizei
);
static
ALCboolean
(
ALC_APIENTRY
*
palcSetThreadContext
)(
ALCcontext
*
);
static
HINSTANCE
instance
;
...
...
@@ -101,6 +102,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved)
return
FALSE
;
}
if
(
!
alcIsExtensionPresent
(
NULL
,
"ALC_EXT_thread_local_context"
)
||
!
(
palcSetThreadContext
=
alcGetProcAddress
(
NULL
,
"alcSetThreadContext"
))){
ERR
(
"XAudio2 requires the ALC_EXT_thread_local_context extension (OpenAL-Soft >= 1.12)
\n
"
);
return
FALSE
;
}
break
;
}
return
TRUE
;
...
...
@@ -313,6 +320,8 @@ static HRESULT WINAPI XA2SRC_SetVolume(IXAudio2SourceVoice *iface, float Volume,
al_gain
=
Volume
;
palcSetThreadContext
(
This
->
xa2
->
al_ctx
);
alSourcef
(
This
->
al_src
,
AL_GAIN
,
al_gain
);
return
S_OK
;
...
...
@@ -366,6 +375,8 @@ static void WINAPI XA2SRC_DestroyVoice(IXAudio2SourceVoice *iface)
TRACE
(
"%p
\n
"
,
This
);
palcSetThreadContext
(
This
->
xa2
->
al_ctx
);
EnterCriticalSection
(
&
This
->
lock
);
if
(
!
This
->
in_use
){
...
...
@@ -728,6 +739,8 @@ static HRESULT WINAPI XA2SRC_SetFrequencyRatio(IXAudio2SourceVoice *iface,
else
r
=
Ratio
;
palcSetThreadContext
(
This
->
xa2
->
al_ctx
);
alSourcef
(
This
->
al_src
,
AL_PITCH
,
r
);
return
S_OK
;
...
...
@@ -740,6 +753,8 @@ static void WINAPI XA2SRC_GetFrequencyRatio(IXAudio2SourceVoice *iface, float *p
TRACE
(
"%p, %p
\n
"
,
This
,
pRatio
);
palcSetThreadContext
(
This
->
xa2
->
al_ctx
);
alGetSourcef
(
This
->
al_src
,
AL_PITCH
,
&
ratio
);
*
pRatio
=
ratio
;
...
...
@@ -1377,6 +1392,8 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface,
dump_fmt
(
pSourceFormat
);
palcSetThreadContext
(
This
->
al_ctx
);
EnterCriticalSection
(
&
This
->
lock
);
LIST_FOR_EACH_ENTRY
(
src
,
&
This
->
source_voices
,
XA2SourceImpl
,
entry
){
...
...
@@ -1752,12 +1769,6 @@ static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface,
goto
exit
;
}
if
(
alcMakeContextCurrent
(
This
->
al_ctx
)
==
ALC_FALSE
){
WARN
(
"alcMakeContextCurrent failed
\n
"
);
hr
=
COMPAT_E_DEVICE_INVALIDATED
;
goto
exit
;
}
hr
=
IAudioClient_Start
(
This
->
aclient
);
if
(
FAILED
(
hr
))
{
...
...
@@ -2415,6 +2426,8 @@ static DWORD WINAPI engine_threadproc(void *arg)
continue
;
}
palcSetThreadContext
(
This
->
al_ctx
);
do_engine_tick
(
This
);
LeaveCriticalSection
(
&
This
->
lock
);
...
...
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