Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e7a65239
Commit
e7a65239
authored
Sep 14, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Sep 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa.drv: Allow creation of the default device even if all real devices failed to open.
parent
c0a8694b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+9
-5
No files found.
dlls/winealsa.drv/mmdevdrv.c
View file @
e7a65239
...
...
@@ -238,7 +238,8 @@ int WINAPI AUDDRV_GetPriority(void)
}
static
HRESULT
alsa_get_card_devices
(
EDataFlow
flow
,
WCHAR
**
ids
,
char
**
keys
,
UINT
*
num
,
snd_ctl_t
*
ctl
,
int
card
,
const
WCHAR
*
cardnameW
)
UINT
*
num
,
snd_ctl_t
*
ctl
,
int
card
,
const
WCHAR
*
cardnameW
,
BOOL
count_failed
)
{
static
const
WCHAR
dashW
[]
=
{
' '
,
'-'
,
' '
,
0
};
int
err
,
device
;
...
...
@@ -276,6 +277,8 @@ static HRESULT alsa_get_card_devices(EDataFlow flow, WCHAR **ids, char **keys,
if
((
err
=
snd_pcm_open
(
&
handle
,
devnode
,
stream
,
SND_PCM_NONBLOCK
))
<
0
){
WARN
(
"The device
\"
%s
\"
failed to open, pretending it doesn't exist: %d (%s)
\n
"
,
devnode
,
err
,
snd_strerror
(
err
));
if
(
count_failed
)
++
(
*
num
);
continue
;
}
...
...
@@ -328,7 +331,7 @@ static HRESULT alsa_get_card_devices(EDataFlow flow, WCHAR **ids, char **keys,
}
static
HRESULT
alsa_enum_devices
(
EDataFlow
flow
,
WCHAR
**
ids
,
char
**
keys
,
UINT
*
num
)
UINT
*
num
,
BOOL
count_failed
)
{
int
err
,
card
;
...
...
@@ -365,7 +368,8 @@ static HRESULT alsa_enum_devices(EDataFlow flow, WCHAR **ids, char **keys,
}
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
cardname
,
-
1
,
cardnameW
,
len
);
alsa_get_card_devices
(
flow
,
ids
,
keys
,
num
,
ctl
,
card
,
cardnameW
);
alsa_get_card_devices
(
flow
,
ids
,
keys
,
num
,
ctl
,
card
,
cardnameW
,
count_failed
);
HeapFree
(
GetProcessHeap
(),
0
,
cardnameW
);
...
...
@@ -386,7 +390,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, char ***keys,
TRACE
(
"%d %p %p %p %p
\n
"
,
flow
,
ids
,
keys
,
num
,
def_index
);
hr
=
alsa_enum_devices
(
flow
,
NULL
,
NULL
,
num
);
hr
=
alsa_enum_devices
(
flow
,
NULL
,
NULL
,
num
,
TRUE
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -411,7 +415,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, char ***keys,
memcpy
((
*
keys
)[
0
],
defname
,
sizeof
(
defname
));
*
def_index
=
0
;
hr
=
alsa_enum_devices
(
flow
,
(
*
ids
)
+
1
,
(
*
keys
)
+
1
,
num
);
hr
=
alsa_enum_devices
(
flow
,
(
*
ids
)
+
1
,
(
*
keys
)
+
1
,
num
,
FALSE
);
if
(
FAILED
(
hr
)){
int
i
;
for
(
i
=
0
;
i
<
*
num
;
++
i
){
...
...
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