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
ceeed96a
Commit
ceeed96a
authored
May 20, 2004
by
Francois Gouget
Committed by
Alexandre Julliard
May 20, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use triggers to disable the sound input/output side we don't care
about when in pseudo fullduplex mode.
parent
ca7ee477
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
audio.c
dlls/winmm/wineoss/audio.c
+38
-3
No files found.
dlls/winmm/wineoss/audio.c
View file @
ceeed96a
...
...
@@ -392,10 +392,19 @@ static DWORD OSS_OpenDevice(OSS_DEVICE* ossdev, unsigned req_access,
int
sample_rate
,
int
stereo
,
int
fmt
)
{
DWORD
ret
;
DWORD
open_access
;
TRACE
(
"(%p,%u,%p,%d,%d,%d,%x)
\n
"
,
ossdev
,
req_access
,
frag
,
strict_format
,
sample_rate
,
stereo
,
fmt
);
if
(
ossdev
->
full_duplex
&&
(
req_access
==
O_RDONLY
||
req_access
==
O_WRONLY
))
req_access
=
O_RDWR
;
{
TRACE
(
"Opening RDWR because full_duplex=%d and req_access=%d
\n
"
,
ossdev
->
full_duplex
,
req_access
);
open_access
=
O_RDWR
;
}
else
{
open_access
=
req_access
;
}
/* FIXME: this should be protected, and it also contains a race with OSS_CloseDevice */
if
(
ossdev
->
open_count
==
0
)
...
...
@@ -406,15 +415,28 @@ static DWORD OSS_OpenDevice(OSS_DEVICE* ossdev, unsigned req_access,
ossdev
->
sample_rate
=
sample_rate
;
ossdev
->
stereo
=
stereo
;
ossdev
->
format
=
fmt
;
ossdev
->
open_access
=
req
_access
;
ossdev
->
open_access
=
open
_access
;
ossdev
->
owner_tid
=
GetCurrentThreadId
();
if
((
ret
=
OSS_RawOpenDevice
(
ossdev
,
strict_format
))
!=
MMSYSERR_NOERROR
)
return
ret
;
if
(
ossdev
->
full_duplex
&&
ossdev
->
bTriggerSupport
&&
(
req_access
==
O_RDONLY
||
req_access
==
O_WRONLY
))
{
int
enable
;
if
(
req_access
==
O_WRONLY
)
ossdev
->
bInputEnabled
=
0
;
else
ossdev
->
bOutputEnabled
=
0
;
enable
=
getEnables
(
ossdev
);
TRACE
(
"Calling SNDCTL_DSP_SETTRIGGER with %x
\n
"
,
enable
);
if
(
ioctl
(
ossdev
->
fd
,
SNDCTL_DSP_SETTRIGGER
,
&
enable
)
<
0
)
ERR
(
"ioctl(%s, SNDCTL_DSP_SETTRIGGER, %d) failed (%s)
\n
"
,
ossdev
->
dev_name
,
enable
,
strerror
(
errno
));
}
}
else
{
/* check we really open with the same parameters */
if
(
ossdev
->
open_access
!=
req
_access
)
if
(
ossdev
->
open_access
!=
open
_access
)
{
ERR
(
"FullDuplex: Mismatch in access. Your sound device is not full duplex capable.
\n
"
);
return
WAVERR_BADFORMAT
;
...
...
@@ -446,6 +468,19 @@ static DWORD OSS_OpenDevice(OSS_DEVICE* ossdev, unsigned req_access,
WARN
(
"Another thread is trying to access audio...
\n
"
);
return
MMSYSERR_ERROR
;
}
if
(
ossdev
->
full_duplex
&&
ossdev
->
bTriggerSupport
&&
(
req_access
==
O_RDONLY
||
req_access
==
O_WRONLY
))
{
int
enable
;
if
(
req_access
==
O_WRONLY
)
ossdev
->
bOutputEnabled
=
1
;
else
ossdev
->
bInputEnabled
=
1
;
enable
=
getEnables
(
ossdev
);
TRACE
(
"Calling SNDCTL_DSP_SETTRIGGER with %x
\n
"
,
enable
);
if
(
ioctl
(
ossdev
->
fd
,
SNDCTL_DSP_SETTRIGGER
,
&
enable
)
<
0
)
ERR
(
"ioctl(%s, SNDCTL_DSP_SETTRIGGER, %d) failed (%s)
\n
"
,
ossdev
->
dev_name
,
enable
,
strerror
(
errno
));
}
}
ossdev
->
open_count
++
;
...
...
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