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
066ac0a8
Commit
066ac0a8
authored
Jul 02, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Jul 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa: Move create_session into mmdevapi.
parent
75276f01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
27 deletions
+6
-27
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+6
-27
No files found.
dlls/winealsa.drv/mmdevdrv.c
View file @
066ac0a8
...
...
@@ -61,7 +61,7 @@ static CRITICAL_SECTION_DEBUG g_sessions_lock_debug =
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": g_sessions_lock"
)
}
};
static
CRITICAL_SECTION
g_sessions_lock
=
{
&
g_sessions_lock_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
struct
list
g_sessions
=
LIST_INIT
(
g_sessions
)
;
extern
struct
list
sessions
;
static
WCHAR
drv_key_devicesW
[
256
];
static
const
WCHAR
guidW
[]
=
{
'g'
,
'u'
,
'i'
,
'd'
,
0
};
...
...
@@ -377,29 +377,8 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
extern
void
session_init_vols
(
AudioSession
*
session
,
UINT
channels
);
static
AudioSession
*
create_session
(
const
GUID
*
guid
,
IMMDevice
*
device
,
UINT
num_channels
)
{
AudioSession
*
ret
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
AudioSession
));
if
(
!
ret
)
return
NULL
;
memcpy
(
&
ret
->
guid
,
guid
,
sizeof
(
GUID
));
ret
->
device
=
device
;
list_init
(
&
ret
->
clients
);
list_add_head
(
&
g_sessions
,
&
ret
->
entry
);
session_init_vols
(
ret
,
num_channels
);
ret
->
master_vol
=
1
.
f
;
return
ret
;
}
extern
AudioSession
*
session_create
(
const
GUID
*
guid
,
IMMDevice
*
device
,
UINT
num_channels
);
/* if channels == 0, then this will return or create a session with
* matching dataflow and GUID. otherwise, channels must also match */
...
...
@@ -409,7 +388,7 @@ HRESULT get_audio_session(const GUID *sessionguid,
AudioSession
*
session
;
if
(
!
sessionguid
||
IsEqualGUID
(
sessionguid
,
&
GUID_NULL
)){
*
out
=
create_session
(
&
GUID_NULL
,
device
,
channels
);
*
out
=
session_create
(
&
GUID_NULL
,
device
,
channels
);
if
(
!*
out
)
return
E_OUTOFMEMORY
;
...
...
@@ -417,7 +396,7 @@ HRESULT get_audio_session(const GUID *sessionguid,
}
*
out
=
NULL
;
LIST_FOR_EACH_ENTRY
(
session
,
&
g_
sessions
,
AudioSession
,
entry
){
LIST_FOR_EACH_ENTRY
(
session
,
&
sessions
,
AudioSession
,
entry
){
if
(
session
->
device
==
device
&&
IsEqualGUID
(
sessionguid
,
&
session
->
guid
)){
session_init_vols
(
session
,
channels
);
...
...
@@ -427,7 +406,7 @@ HRESULT get_audio_session(const GUID *sessionguid,
}
if
(
!*
out
){
*
out
=
create_session
(
sessionguid
,
device
,
channels
);
*
out
=
session_create
(
sessionguid
,
device
,
channels
);
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