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
fdda702a
Commit
fdda702a
authored
Sep 28, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Sep 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss.drv: Use a temporary OSS device to check format support.
parent
f7364dfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+18
-8
No files found.
dlls/wineoss.drv/mmdevdrv.c
View file @
fdda702a
...
...
@@ -667,7 +667,7 @@ static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt)
return
ret
;
}
static
HRESULT
setup_oss_device
(
ACImpl
*
This
,
const
WAVEFORMATEX
*
fmt
,
static
HRESULT
setup_oss_device
(
int
fd
,
const
WAVEFORMATEX
*
fmt
,
WAVEFORMATEX
**
out
,
BOOL
query
)
{
int
tmp
,
oss_format
;
...
...
@@ -682,7 +682,7 @@ static HRESULT setup_oss_device(ACImpl *This, const WAVEFORMATEX *fmt,
tmp
=
oss_format
=
get_oss_format
(
fmt
);
if
(
oss_format
<
0
)
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
if
(
ioctl
(
This
->
fd
,
SNDCTL_DSP_SETFMT
,
&
tmp
)
<
0
){
if
(
ioctl
(
fd
,
SNDCTL_DSP_SETFMT
,
&
tmp
)
<
0
){
WARN
(
"SETFMT failed: %d (%s)
\n
"
,
errno
,
strerror
(
errno
));
return
E_FAIL
;
}
...
...
@@ -696,7 +696,7 @@ static HRESULT setup_oss_device(ACImpl *This, const WAVEFORMATEX *fmt,
return
E_OUTOFMEMORY
;
tmp
=
fmt
->
nSamplesPerSec
;
if
(
ioctl
(
This
->
fd
,
SNDCTL_DSP_SPEED
,
&
tmp
)
<
0
){
if
(
ioctl
(
fd
,
SNDCTL_DSP_SPEED
,
&
tmp
)
<
0
){
WARN
(
"SPEED failed: %d (%s)
\n
"
,
errno
,
strerror
(
errno
));
CoTaskMemFree
(
closest
);
return
E_FAIL
;
...
...
@@ -708,7 +708,7 @@ static HRESULT setup_oss_device(ACImpl *This, const WAVEFORMATEX *fmt,
}
tmp
=
fmt
->
nChannels
;
if
(
ioctl
(
This
->
fd
,
SNDCTL_DSP_CHANNELS
,
&
tmp
)
<
0
){
if
(
ioctl
(
fd
,
SNDCTL_DSP_CHANNELS
,
&
tmp
)
<
0
){
WARN
(
"CHANNELS failed: %d (%s)
\n
"
,
errno
,
strerror
(
errno
));
CoTaskMemFree
(
closest
);
return
E_FAIL
;
...
...
@@ -862,7 +862,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
return
AUDCLNT_E_ALREADY_INITIALIZED
;
}
hr
=
setup_oss_device
(
This
,
fmt
,
NULL
,
FALSE
);
hr
=
setup_oss_device
(
This
->
fd
,
fmt
,
NULL
,
FALSE
);
if
(
hr
==
S_FALSE
){
LeaveCriticalSection
(
&
This
->
lock
);
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
...
...
@@ -1082,6 +1082,7 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
WAVEFORMATEX
**
outpwfx
)
{
ACImpl
*
This
=
impl_from_IAudioClient
(
iface
);
int
fd
=
-
1
;
HRESULT
ret
;
TRACE
(
"(%p)->(%x, %p, %p)
\n
"
,
This
,
mode
,
pwfx
,
outpwfx
);
...
...
@@ -1098,11 +1099,20 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
dump_fmt
(
pwfx
);
EnterCriticalSection
(
&
This
->
lock
);
if
(
This
->
dataflow
==
eRender
)
fd
=
open
(
This
->
ai
.
devnode
,
O_WRONLY
,
0
);
else
if
(
This
->
dataflow
==
eCapture
)
fd
=
open
(
This
->
ai
.
devnode
,
O_RDONLY
,
0
);
if
(
fd
<
0
){
ERR
(
"Unable to open device %s: %d (%s)
\n
"
,
This
->
ai
.
devnode
,
errno
,
strerror
(
errno
));
return
AUDCLNT_E_DEVICE_INVALIDATED
;
}
ret
=
setup_oss_device
(
This
,
pwfx
,
outpwfx
,
TRUE
);
ret
=
setup_oss_device
(
fd
,
pwfx
,
outpwfx
,
TRUE
);
LeaveCriticalSection
(
&
This
->
lock
);
close
(
fd
);
return
ret
;
}
...
...
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