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
bf527c00
Commit
bf527c00
authored
Jan 20, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faudio: Import upstream release 22.01.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
879ccd33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
FAudio.h
libs/faudio/include/FAudio.h
+2
-2
FAudio_platform_win32.c
libs/faudio/src/FAudio_platform_win32.c
+48
-0
No files found.
libs/faudio/include/FAudio.h
View file @
bf527c00
...
...
@@ -484,8 +484,8 @@ extern FAudioGUID DATAFORMAT_SUBTYPE_IEEE_FLOAT;
#define FAUDIO_TARGET_VERSION 8
/* Targeting compatibility with XAudio 2.8 */
#define FAUDIO_ABI_VERSION 0
#define FAUDIO_MAJOR_VERSION 2
1
#define FAUDIO_MINOR_VERSION
1
1
#define FAUDIO_MAJOR_VERSION 2
2
#define FAUDIO_MINOR_VERSION
1
#define FAUDIO_PATCH_VERSION 0
#define FAUDIO_COMPILED_VERSION ( \
...
...
libs/faudio/src/FAudio_platform_win32.c
View file @
bf527c00
...
...
@@ -70,6 +70,44 @@ void FAudio_Log(char const *msg)
OutputDebugStringA
(
msg
);
}
static
HMODULE
kernelbase
=
NULL
;
static
HRESULT
(
WINAPI
*
my_SetThreadDescription
)(
HANDLE
,
PCWSTR
)
=
NULL
;
static
void
FAudio_resolve_SetThreadDescription
(
void
)
{
kernelbase
=
LoadLibraryA
(
"kernelbase.dll"
);
if
(
!
kernelbase
)
return
;
my_SetThreadDescription
=
(
HRESULT
(
WINAPI
*
)(
HANDLE
,
PCWSTR
))
GetProcAddress
(
kernelbase
,
"SetThreadDescription"
);
if
(
!
my_SetThreadDescription
)
{
FreeLibrary
(
kernelbase
);
kernelbase
=
NULL
;
}
}
static
void
FAudio_set_thread_name
(
char
const
*
name
)
{
int
ret
;
WCHAR
*
nameW
;
if
(
!
my_SetThreadDescription
)
return
;
ret
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
name
,
-
1
,
NULL
,
0
);
nameW
=
FAudio_malloc
(
ret
*
sizeof
(
WCHAR
));
if
(
!
nameW
)
return
;
ret
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
name
,
-
1
,
nameW
,
ret
);
if
(
ret
)
my_SetThreadDescription
(
GetCurrentThread
(),
nameW
);
FAudio_free
(
nameW
);
}
static
HRESULT
FAudio_FillAudioClientBuffer
(
struct
FAudioAudioClientThreadArgs
*
args
,
IAudioRenderClient
*
client
,
...
...
@@ -121,6 +159,8 @@ static DWORD WINAPI FAudio_AudioClientThread(void *user)
HRESULT
hr
=
S_OK
;
UINT
frames
,
padding
=
0
;
FAudio_set_thread_name
(
__func__
);
hr
=
IAudioClient_GetService
(
args
->
client
,
&
IID_IAudioRenderClient
,
...
...
@@ -172,6 +212,7 @@ void FAudio_PlatformInit(
BOOL
has_sse2
=
IsProcessorFeaturePresent
(
PF_XMMI64_INSTRUCTIONS_AVAILABLE
);
FAudio_INTERNAL_InitSIMDFunctions
(
has_sse2
,
FALSE
);
FAudio_resolve_SetThreadDescription
();
FAudio_PlatformAddRef
();
...
...
@@ -305,6 +346,12 @@ void FAudio_PlatformQuit(void* platformDevice)
SetEvent
(
data
->
stopEvent
);
WaitForSingleObject
(
data
->
audioThread
,
INFINITE
);
if
(
data
->
client
)
IAudioClient_Release
(
data
->
client
);
if
(
kernelbase
)
{
my_SetThreadDescription
=
NULL
;
FreeLibrary
(
kernelbase
);
kernelbase
=
NULL
;
}
FAudio_PlatformRelease
();
}
...
...
@@ -500,6 +547,7 @@ static DWORD WINAPI FaudioThreadWrapper(void *user)
struct
FAudioThreadArgs
*
args
=
user
;
DWORD
ret
;
FAudio_set_thread_name
(
args
->
name
);
ret
=
args
->
func
(
args
->
data
);
FAudio_free
(
args
);
...
...
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