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
c6a97c0f
Commit
c6a97c0f
authored
Apr 08, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Apr 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Implement and call set_event_handle in unixlib.
parent
356a9373
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
19 deletions
+54
-19
coreaudio.c
dlls/winecoreaudio.drv/coreaudio.c
+45
-3
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+9
-16
No files found.
dlls/winecoreaudio.drv/coreaudio.c
View file @
c6a97c0f
...
...
@@ -85,6 +85,7 @@ struct coreaudio_stream
EDataFlow
flow
;
DWORD
flags
;
AUDCLNT_SHAREMODE
share
;
HANDLE
event
;
BOOL
playing
;
REFERENCE_TIME
period
;
...
...
@@ -1308,7 +1309,9 @@ static NTSTATUS unix_start(void *args)
OSSpinLockLock
(
&
stream
->
lock
);
if
(
stream
->
playing
)
if
((
stream
->
flags
&
AUDCLNT_STREAMFLAGS_EVENTCALLBACK
)
&&
!
stream
->
event
)
params
->
result
=
AUDCLNT_E_EVENTHANDLE_NOT_SET
;
else
if
(
stream
->
playing
)
params
->
result
=
AUDCLNT_E_NOT_STOPPED
;
else
{
stream
->
playing
=
TRUE
;
...
...
@@ -1653,6 +1656,27 @@ static NTSTATUS unix_set_volumes(void *args)
return
STATUS_SUCCESS
;
}
static
NTSTATUS
unix_set_event_handle
(
void
*
args
)
{
struct
set_event_handle_params
*
params
=
args
;
struct
coreaudio_stream
*
stream
=
handle_get_stream
(
params
->
stream
);
HRESULT
hr
=
S_OK
;
OSSpinLockLock
(
&
stream
->
lock
);
if
(
!
stream
->
unit
)
hr
=
AUDCLNT_E_DEVICE_INVALIDATED
;
else
if
(
!
(
stream
->
flags
&
AUDCLNT_STREAMFLAGS_EVENTCALLBACK
))
hr
=
AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED
;
else
if
(
stream
->
event
)
hr
=
HRESULT_FROM_WIN32
(
ERROR_INVALID_NAME
);
else
stream
->
event
=
params
->
event
;
OSSpinLockUnlock
(
&
stream
->
lock
);
params
->
result
=
hr
;
return
STATUS_SUCCESS
;
}
unixlib_entry_t
__wine_unix_call_funcs
[]
=
{
unix_not_implemented
,
...
...
@@ -1679,7 +1703,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
unix_get_frequency
,
unix_get_position
,
unix_set_volumes
,
unix_
not_implemented
,
unix_
set_event_handle
,
unix_not_implemented
,
unix_is_started
,
unix_not_implemented
,
...
...
@@ -1997,6 +2021,24 @@ static NTSTATUS unix_wow64_set_volumes(void *args)
return
unix_set_volumes
(
&
params
);
}
static
NTSTATUS
unix_wow64_set_event_handle
(
void
*
args
)
{
struct
{
stream_handle
stream
;
PTR32
event
;
HRESULT
result
;
}
*
params32
=
args
;
struct
set_event_handle_params
params
=
{
.
stream
=
params32
->
stream
,
.
event
=
ULongToHandle
(
params32
->
event
)
};
unix_set_event_handle
(
&
params
);
params32
->
result
=
params
.
result
;
return
STATUS_SUCCESS
;
}
unixlib_entry_t
__wine_unix_call_wow64_funcs
[]
=
{
unix_not_implemented
,
...
...
@@ -2023,7 +2065,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] =
unix_wow64_get_frequency
,
unix_wow64_get_position
,
unix_wow64_set_volumes
,
unix_
not_implemented
,
unix_
wow64_set_event_handle
,
unix_not_implemented
,
unix_is_started
,
unix_not_implemented
,
...
...
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
c6a97c0f
...
...
@@ -92,7 +92,6 @@ struct ACImpl {
EDataFlow
dataflow
;
UINT32
channel_count
,
period_ms
;
DWORD
flags
;
HANDLE
event
;
float
*
vols
;
...
...
@@ -752,7 +751,6 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
return
params
.
result
;
}
This
->
flags
=
flags
;
This
->
channel_count
=
fmt
->
nChannels
;
This
->
period_ms
=
period
/
10000
;
...
...
@@ -942,9 +940,6 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
if
((
This
->
flags
&
AUDCLNT_STREAMFLAGS_EVENTCALLBACK
)
&&
!
This
->
event
)
return
AUDCLNT_E_EVENTHANDLE_NOT_SET
;
params
.
stream
=
This
->
stream
;
UNIX_CALL
(
start
,
&
params
);
...
...
@@ -996,7 +991,7 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
HANDLE
event
)
{
ACImpl
*
This
=
impl_from_IAudioClient3
(
iface
);
HRESULT
hr
=
S_OK
;
struct
set_event_handle_params
params
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
event
);
...
...
@@ -1006,19 +1001,17 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
if
(
!
This
->
stream
)
return
AUDCLNT_E_NOT_INITIALIZED
;
EnterCriticalSection
(
&
g_sessions_lock
);
params
.
stream
=
This
->
stream
;
params
.
event
=
event
;
UNIX_CALL
(
set_event_handle
,
&
params
);
if
(
!
(
This
->
flags
&
AUDCLNT_STREAMFLAGS_EVENTCALLBACK
))
hr
=
AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED
;
else
if
(
This
->
event
){
FIXME
(
"called twice
\n
"
);
hr
=
HRESULT_FROM_WIN32
(
ERROR_INVALID_NAME
);
}
else
if
(
SUCCEEDED
(
params
.
result
)){
EnterCriticalSection
(
&
g_sessions_lock
);
This
->
event
=
event
;
LeaveCriticalSection
(
&
g_sessions_lock
);
}
LeaveCriticalSection
(
&
g_sessions_lock
);
return
hr
;
return
params
.
result
;
}
static
HRESULT
WINAPI
AudioClient_GetService
(
IAudioClient3
*
iface
,
REFIID
riid
,
...
...
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