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
2174717f
Commit
2174717f
authored
Jul 13, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Jul 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Only enumerate devices that can be opened during initialization.
parent
deac5ceb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+15
-3
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+12
-0
No files found.
dlls/winealsa.drv/mmdevdrv.c
View file @
2174717f
...
...
@@ -229,19 +229,22 @@ static HRESULT alsa_get_card_devices(EDataFlow flow, WCHAR **ids, char **keys,
static
const
WCHAR
dashW
[]
=
{
' '
,
'-'
,
' '
,
0
};
int
err
,
device
;
snd_pcm_info_t
*
info
;
snd_pcm_stream_t
stream
=
(
flow
==
eRender
?
SND_PCM_STREAM_PLAYBACK
:
SND_PCM_STREAM_CAPTURE
);
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
snd_pcm_info_sizeof
());
if
(
!
info
)
return
E_OUTOFMEMORY
;
snd_pcm_info_set_subdevice
(
info
,
0
);
snd_pcm_info_set_stream
(
info
,
flow
==
eRender
?
SND_PCM_STREAM_PLAYBACK
:
SND_PCM_STREAM_CAPTURE
);
snd_pcm_info_set_stream
(
info
,
stream
);
device
=
-
1
;
for
(
err
=
snd_ctl_pcm_next_device
(
ctl
,
&
device
);
device
!=
-
1
&&
err
>=
0
;
err
=
snd_ctl_pcm_next_device
(
ctl
,
&
device
)){
const
char
*
devname
;
char
devnode
[
32
];
snd_pcm_t
*
handle
;
snd_pcm_info_set_device
(
info
,
device
);
...
...
@@ -255,6 +258,15 @@ static HRESULT alsa_get_card_devices(EDataFlow flow, WCHAR **ids, char **keys,
continue
;
}
sprintf
(
devnode
,
"hw:%d,%d"
,
card
,
device
);
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
));
continue
;
}
snd_pcm_close
(
handle
);
if
(
ids
&&
keys
){
DWORD
len
,
cardlen
;
...
...
@@ -286,7 +298,7 @@ static HRESULT alsa_get_card_devices(EDataFlow flow, WCHAR **ids, char **keys,
HeapFree
(
GetProcessHeap
(),
0
,
ids
[
*
num
]);
return
E_OUTOFMEMORY
;
}
sprintf
(
keys
[
*
num
],
"hw:%d,%d"
,
card
,
device
);
memcpy
(
keys
[
*
num
],
devnode
,
sizeof
(
devnode
)
);
}
++
(
*
num
);
...
...
dlls/wineoss.drv/mmdevdrv.c
View file @
2174717f
...
...
@@ -285,6 +285,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, void ***keys,
*
def_index
=
-
1
;
for
(
i
=
0
;
i
<
sysinfo
.
numaudios
;
++
i
){
oss_audioinfo
ai
=
{
0
};
int
fd
;
ai
.
dev
=
i
;
if
(
ioctl
(
mixer_fd
,
SNDCTL_AUDIOINFO
,
&
ai
)
<
0
){
...
...
@@ -293,6 +294,17 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, void ***keys,
continue
;
}
if
(
flow
==
eRender
)
fd
=
open
(
ai
.
devnode
,
O_WRONLY
,
0
);
else
fd
=
open
(
ai
.
devnode
,
O_RDONLY
,
0
);
if
(
fd
<
0
){
WARN
(
"Opening device
\"
%s
\"
failed, pretending it doesn't exist: %d (%s)"
,
ai
.
devnode
,
errno
,
strerror
(
errno
));
continue
;
}
close
(
fd
);
if
((
flow
==
eCapture
&&
(
ai
.
caps
&
PCM_CAP_INPUT
))
||
(
flow
==
eRender
&&
(
ai
.
caps
&
PCM_CAP_OUTPUT
))){
size_t
len
;
...
...
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