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
b87ee7d4
Commit
b87ee7d4
authored
May 24, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
May 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss: Move stream mode and period/duration initialization logic into unixlib.
parent
396acb0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
26 deletions
+33
-26
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+0
-25
oss.c
dlls/wineoss.drv/oss.c
+33
-1
No files found.
dlls/wineoss.drv/mmdevdrv.c
View file @
b87ee7d4
...
@@ -50,9 +50,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(oss);
...
@@ -50,9 +50,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(oss);
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
static
const
REFERENCE_TIME
DefaultPeriod
=
100000
;
static
const
REFERENCE_TIME
MinimumPeriod
=
50000
;
typedef
struct
_OSSDevice
{
typedef
struct
_OSSDevice
{
struct
list
entry
;
struct
list
entry
;
EDataFlow
flow
;
EDataFlow
flow
;
...
@@ -581,28 +578,6 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
...
@@ -581,28 +578,6 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
return
E_INVALIDARG
;
return
E_INVALIDARG
;
}
}
if
(
mode
==
AUDCLNT_SHAREMODE_SHARED
){
period
=
DefaultPeriod
;
if
(
duration
<
3
*
period
)
duration
=
3
*
period
;
}
else
{
if
(
!
period
)
period
=
DefaultPeriod
;
/* not minimum */
if
(
period
<
MinimumPeriod
||
period
>
5000000
)
return
AUDCLNT_E_INVALID_DEVICE_PERIOD
;
if
(
duration
>
20000000
)
/* the smaller the period, the lower this limit */
return
AUDCLNT_E_BUFFER_SIZE_ERROR
;
if
(
flags
&
AUDCLNT_STREAMFLAGS_EVENTCALLBACK
){
if
(
duration
!=
period
)
return
AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL
;
FIXME
(
"EXCLUSIVE mode with EVENTCALLBACK
\n
"
);
return
AUDCLNT_E_DEVICE_IN_USE
;
}
else
{
if
(
duration
<
8
*
period
)
duration
=
8
*
period
;
/* may grow above 2s */
}
}
sessions_lock
();
sessions_lock
();
if
(
This
->
stream
){
if
(
This
->
stream
){
...
...
dlls/wineoss.drv/oss.c
View file @
b87ee7d4
...
@@ -555,11 +555,43 @@ static ULONG_PTR zero_bits(void)
...
@@ -555,11 +555,43 @@ static ULONG_PTR zero_bits(void)
static
NTSTATUS
oss_create_stream
(
void
*
args
)
static
NTSTATUS
oss_create_stream
(
void
*
args
)
{
{
struct
create_stream_params
*
params
=
args
;
struct
create_stream_params
*
params
=
args
;
WAVEFORMATEXTENSIBLE
*
fmtex
;
WAVEFORMATEXTENSIBLE
*
fmtex
=
(
WAVEFORMATEXTENSIBLE
*
)
params
->
fmt
;
struct
oss_stream
*
stream
;
struct
oss_stream
*
stream
;
oss_audioinfo
ai
;
oss_audioinfo
ai
;
SIZE_T
size
;
SIZE_T
size
;
params
->
result
=
S_OK
;
if
(
params
->
share
==
AUDCLNT_SHAREMODE_SHARED
)
{
params
->
period
=
def_period
;
if
(
params
->
duration
<
3
*
params
->
period
)
params
->
duration
=
3
*
params
->
period
;
}
else
{
if
(
fmtex
->
Format
.
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
&&
(
fmtex
->
dwChannelMask
==
0
||
fmtex
->
dwChannelMask
&
SPEAKER_RESERVED
))
params
->
result
=
AUDCLNT_E_UNSUPPORTED_FORMAT
;
else
{
if
(
!
params
->
period
)
params
->
period
=
def_period
;
if
(
params
->
period
<
min_period
||
params
->
period
>
5000000
)
params
->
result
=
AUDCLNT_E_INVALID_DEVICE_PERIOD
;
else
if
(
params
->
duration
>
20000000
)
/* The smaller the period, the lower this limit. */
params
->
result
=
AUDCLNT_E_BUFFER_SIZE_ERROR
;
else
if
(
params
->
flags
&
AUDCLNT_STREAMFLAGS_EVENTCALLBACK
)
{
if
(
params
->
duration
!=
params
->
period
)
params
->
result
=
AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL
;
FIXME
(
"EXCLUSIVE mode with EVENTCALLBACK
\n
"
);
params
->
result
=
AUDCLNT_E_DEVICE_IN_USE
;
}
else
if
(
params
->
duration
<
8
*
params
->
period
)
params
->
duration
=
8
*
params
->
period
;
/* May grow above 2s. */
}
}
if
(
FAILED
(
params
->
result
))
return
STATUS_SUCCESS
;
stream
=
calloc
(
1
,
sizeof
(
*
stream
));
stream
=
calloc
(
1
,
sizeof
(
*
stream
));
if
(
!
stream
){
if
(
!
stream
){
params
->
result
=
E_OUTOFMEMORY
;
params
->
result
=
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