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
d94ac14e
Commit
d94ac14e
authored
Jun 01, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Jun 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss: Use mmdevapi's session_wrapper_create.
parent
883f1f34
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
30 deletions
+7
-30
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+7
-30
No files found.
dlls/wineoss.drv/mmdevdrv.c
View file @
d94ac14e
...
...
@@ -72,8 +72,6 @@ static CRITICAL_SECTION_DEBUG g_sessions_lock_debug =
static
CRITICAL_SECTION
g_sessions_lock
=
{
&
g_sessions_lock_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
struct
list
g_sessions
=
LIST_INIT
(
g_sessions
);
static
AudioSessionWrapper
*
AudioSessionWrapper_Create
(
ACImpl
*
client
);
static
const
IAudioClient3Vtbl
AudioClient3_Vtbl
;
extern
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
extern
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
...
...
@@ -84,6 +82,9 @@ extern const IAudioClock2Vtbl AudioClock2_Vtbl;
extern
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
extern
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
;
extern
struct
audio_session_wrapper
*
session_wrapper_create
(
struct
audio_client
*
client
)
DECLSPEC_HIDDEN
;
void
DECLSPEC_HIDDEN
sessions_lock
(
void
)
{
EnterCriticalSection
(
&
g_sessions_lock
);
...
...
@@ -897,7 +898,7 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid,
*
ppv
=
&
This
->
IAudioStreamVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionControl
)){
if
(
!
This
->
session_wrapper
){
This
->
session_wrapper
=
AudioSessionWrapper_C
reate
(
This
);
This
->
session_wrapper
=
session_wrapper_c
reate
(
This
);
if
(
!
This
->
session_wrapper
){
sessions_unlock
();
return
E_OUTOFMEMORY
;
...
...
@@ -908,7 +909,7 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid,
*
ppv
=
&
This
->
session_wrapper
->
IAudioSessionControl2_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
)){
if
(
!
This
->
session_wrapper
){
This
->
session_wrapper
=
AudioSessionWrapper_C
reate
(
This
);
This
->
session_wrapper
=
session_wrapper_c
reate
(
This
);
if
(
!
This
->
session_wrapper
){
sessions_unlock
();
return
E_OUTOFMEMORY
;
...
...
@@ -919,7 +920,7 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid,
*
ppv
=
&
This
->
session_wrapper
->
IChannelAudioVolume_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_ISimpleAudioVolume
)){
if
(
!
This
->
session_wrapper
){
This
->
session_wrapper
=
AudioSessionWrapper_C
reate
(
This
);
This
->
session_wrapper
=
session_wrapper_c
reate
(
This
);
if
(
!
This
->
session_wrapper
){
sessions_unlock
();
return
E_OUTOFMEMORY
;
...
...
@@ -987,30 +988,6 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl =
client_InitializeSharedAudioStream
,
};
static
AudioSessionWrapper
*
AudioSessionWrapper_Create
(
ACImpl
*
client
)
{
AudioSessionWrapper
*
ret
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
AudioSessionWrapper
));
if
(
!
ret
)
return
NULL
;
ret
->
IAudioSessionControl2_iface
.
lpVtbl
=
&
AudioSessionControl2_Vtbl
;
ret
->
ISimpleAudioVolume_iface
.
lpVtbl
=
&
SimpleAudioVolume_Vtbl
;
ret
->
IChannelAudioVolume_iface
.
lpVtbl
=
&
ChannelAudioVolume_Vtbl
;
ret
->
ref
=
1
;
ret
->
client
=
client
;
if
(
client
){
ret
->
session
=
client
->
session
;
IAudioClient3_AddRef
(
&
client
->
IAudioClient3_iface
);
}
return
ret
;
}
HRESULT
WINAPI
AUDDRV_GetAudioSessionWrapper
(
const
GUID
*
guid
,
IMMDevice
*
device
,
AudioSessionWrapper
**
out
)
{
...
...
@@ -1020,7 +997,7 @@ HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device
if
(
FAILED
(
hr
))
return
hr
;
*
out
=
AudioSessionWrapper_C
reate
(
NULL
);
*
out
=
session_wrapper_c
reate
(
NULL
);
if
(
!*
out
)
return
E_OUTOFMEMORY
;
...
...
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