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
b1821266
Commit
b1821266
authored
Oct 26, 2015
by
Andrew Eikum
Committed by
Alexandre Julliard
Oct 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Fix win10 test failures.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
af0288d4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
38 deletions
+28
-38
capture.c
dlls/mmdevapi/tests/capture.c
+6
-29
render.c
dlls/mmdevapi/tests/render.c
+21
-9
winerror.h
include/winerror.h
+1
-0
No files found.
dlls/mmdevapi/tests/capture.c
View file @
b1821266
...
...
@@ -38,6 +38,9 @@
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
/* undocumented error code */
#define D3D11_ERROR_4E MAKE_HRESULT(SEVERITY_ERROR, FACILITY_DIRECT3D11, 0x4e)
static
IMMDevice
*
dev
=
NULL
;
static
const
LARGE_INTEGER
ullZero
;
...
...
@@ -83,7 +86,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
HRESULT
hr
;
UINT32
frames
,
next
,
pad
,
sum
=
0
;
BYTE
*
data
;
DWORD
flags
,
r
;
DWORD
flags
;
UINT64
pos
,
qpc
;
REFERENCE_TIME
period
;
...
...
@@ -417,32 +420,6 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
IAudioCaptureClient_ReleaseBuffer
(
acc
,
frames
);
}
hr
=
IAudioClient_Stop
(
ac
);
ok
(
hr
==
S_OK
,
"Stop failed: %08x
\n
"
,
hr
);
ok
(
ResetEvent
(
handle
),
"ResetEvent
\n
"
);
/* Still receiving events! */
r
=
WaitForSingleObject
(
handle
,
20
);
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Stop gave %x
\n
"
,
r
);
hr
=
IAudioClient_Reset
(
ac
);
ok
(
hr
==
S_OK
,
"Reset failed: %08x
\n
"
,
hr
);
ok
(
ResetEvent
(
handle
),
"ResetEvent
\n
"
);
r
=
WaitForSingleObject
(
handle
,
120
);
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(event) after Reset gave %x
\n
"
,
r
);
hr
=
IAudioClient_SetEventHandle
(
ac
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"SetEventHandle(NULL) returns %08x
\n
"
,
hr
);
r
=
WaitForSingleObject
(
handle
,
70
);
ok
(
r
==
WAIT_OBJECT_0
,
"Wait(NULL event) gave %x
\n
"
,
r
);
hr
=
IAudioClient_Start
(
ac
);
ok
(
hr
==
S_OK
,
"Start failed: %08x
\n
"
,
hr
);
IAudioCaptureClient_Release
(
acc
);
}
...
...
@@ -593,7 +570,8 @@ static void test_audioclient(void)
ok
(
hr
==
E_INVALIDARG
,
"SetEventHandle(NULL) returns %08x
\n
"
,
hr
);
hr
=
IAudioClient_Start
(
ac
);
ok
(
hr
==
AUDCLNT_E_EVENTHANDLE_NOT_SET
,
"Start before SetEventHandle returns %08x
\n
"
,
hr
);
ok
(
hr
==
AUDCLNT_E_EVENTHANDLE_NOT_SET
||
hr
==
D3D11_ERROR_4E
/* win10 */
,
"Start before SetEventHandle returns %08x
\n
"
,
hr
);
hr
=
IAudioClient_SetEventHandle
(
ac
,
handle
);
ok
(
hr
==
S_OK
,
"SetEventHandle returns %08x
\n
"
,
hr
);
...
...
@@ -847,7 +825,6 @@ static void test_simplevolume(void)
hr
=
ISimpleAudioVolume_GetMasterVolume
(
sav
,
&
vol
);
ok
(
hr
==
S_OK
,
"GetMasterVolume failed: %08x
\n
"
,
hr
);
ok
(
vol
==
1
.
f
,
"Master volume wasn't 1: %f
\n
"
,
vol
);
hr
=
ISimpleAudioVolume_SetMasterVolume
(
sav
,
-
1
.
f
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"SetMasterVolume gave wrong error: %08x
\n
"
,
hr
);
...
...
dlls/mmdevapi/tests/render.c
View file @
b1821266
...
...
@@ -54,9 +54,13 @@ static const unsigned int win_formats[][4] = {
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
/* undocumented error code */
#define D3D11_ERROR_4E MAKE_HRESULT(SEVERITY_ERROR, FACILITY_DIRECT3D11, 0x4e)
static
IMMDeviceEnumerator
*
mme
=
NULL
;
static
IMMDevice
*
dev
=
NULL
;
static
HRESULT
hexcl
=
S_OK
;
/* or AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED */
static
BOOL
win10
=
FALSE
;
static
const
LARGE_INTEGER
ullZero
;
...
...
@@ -281,7 +285,8 @@ static void test_audioclient(void)
fmtex
->
dwChannelMask
=
0xffff
;
hr
=
IAudioClient_Initialize
(
ac
,
AUDCLNT_SHAREMODE_SHARED
,
0
,
5000000
,
0
,
pwfx
,
NULL
);
ok
(
hr
==
S_OK
,
"Initialize(dwChannelMask = 0xffff) returns %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
||
hr
==
AUDCLNT_E_UNSUPPORTED_FORMAT
/* win10 */
,
"Initialize(dwChannelMask = 0xffff) returns %08x
\n
"
,
hr
);
IAudioClient_Release
(
ac
);
...
...
@@ -330,9 +335,12 @@ static void test_audioclient(void)
ok
(
hr
==
S_OK
,
"Valid GetStreamLatency call returns %08x
\n
"
,
hr
);
trace
(
"Returned latency: %u.%04u ms
\n
"
,
(
UINT
)(
t2
/
10000
),
(
UINT
)(
t2
%
10000
));
ok
(
t2
>=
t1
||
broken
(
t2
>=
t1
/
2
&&
pwfx
->
nSamplesPerSec
>
48000
),
"Latency < default period, delta %ldus
\n
"
,
(
long
)((
t2
-
t1
)
/
10
));
ok
(
t2
>=
t1
||
broken
(
t2
>=
t1
/
2
&&
pwfx
->
nSamplesPerSec
>
48000
)
||
broken
(
t2
==
0
)
/* (!) win10 */
,
"Latency < default period, delta %ldus (%llu vs %llu)
\n
"
,
(
long
)((
t2
-
t1
)
/
10
),
t2
,
t1
);
/* Native appears to add the engine period to the HW latency in shared mode */
if
(
t2
==
0
)
win10
=
TRUE
;
hr
=
IAudioClient_Initialize
(
ac
,
AUDCLNT_SHAREMODE_SHARED
,
0
,
5000000
,
0
,
pwfx
,
NULL
);
ok
(
hr
==
AUDCLNT_E_ALREADY_INITIALIZED
,
"Calling Initialize twice returns %08x
\n
"
,
hr
);
...
...
@@ -627,13 +635,15 @@ static void test_event(void)
ok
(
event
!=
NULL
,
"CreateEvent failed
\n
"
);
hr
=
IAudioClient_Start
(
ac
);
ok
(
hr
==
AUDCLNT_E_EVENTHANDLE_NOT_SET
,
"Start failed: %08x
\n
"
,
hr
);
ok
(
hr
==
AUDCLNT_E_EVENTHANDLE_NOT_SET
||
hr
==
D3D11_ERROR_4E
/* win10 */
,
"Start failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_SetEventHandle
(
ac
,
event
);
ok
(
hr
==
S_OK
,
"SetEventHandle failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_SetEventHandle
(
ac
,
event
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_NAME
),
"SetEventHandle returns %08x
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_NAME
)
||
hr
==
E_UNEXPECTED
/* win10 */
,
"SetEventHandle returns %08x
\n
"
,
hr
);
r
=
WaitForSingleObject
(
event
,
40
);
ok
(
r
==
WAIT_TIMEOUT
,
"Wait(event) before Start gave %x
\n
"
,
r
);
...
...
@@ -733,12 +743,15 @@ static void test_padding(void)
hr
=
IAudioRenderClient_GetBuffer
(
arc
,
psize
,
&
buf
);
ok
(
hr
==
S_OK
,
"GetBuffer failed: %08x
\n
"
,
hr
);
ok
(
buf
!=
NULL
,
"NULL buffer returned
\n
"
);
if
(
!
win10
){
/* win10 appears not to clear the buffer */
for
(
i
=
0
;
i
<
psize
*
pwfx
->
nBlockAlign
;
++
i
){
if
(
buf
[
i
]
!=
silence
){
ok
(
0
,
"buffer has data in it already
\n
"
);
ok
(
0
,
"buffer has data in it already, i: %u, valu: %f
\n
"
,
i
,
*
((
float
*
)
buf
)
);
break
;
}
}
}
hr
=
IAudioRenderClient_GetBuffer
(
arc
,
0
,
&
buf
);
ok
(
hr
==
AUDCLNT_E_OUT_OF_ORDER
,
"GetBuffer 0 size failed: %08x
\n
"
,
hr
);
...
...
@@ -910,7 +923,8 @@ static void test_clock(int share)
hr
=
IAudioClient_GetStreamLatency
(
ac
,
&
t2
);
ok
(
hr
==
S_OK
,
"GetStreamLatency failed: %08x
\n
"
,
hr
);
trace
(
"Latency: %u.%04u ms
\n
"
,
(
UINT
)(
t2
/
10000
),
(
UINT
)(
t2
%
10000
));
ok
(
t2
>=
period
||
broken
(
t2
>=
period
/
2
&&
share
&&
pwfx
->
nSamplesPerSec
>
48000
),
ok
(
t2
>=
period
||
broken
(
t2
>=
period
/
2
&&
share
&&
pwfx
->
nSamplesPerSec
>
48000
)
||
broken
(
t2
==
0
)
/* win10 */
,
"Latency < default period, delta %ldus
\n
"
,
(
long
)((
t2
-
period
)
/
10
));
/** GetBufferSize
...
...
@@ -1972,7 +1986,6 @@ static void test_session_creation(void)
vol
=
0
.
5
f
;
hr
=
ISimpleAudioVolume_GetMasterVolume
(
cap_sav
,
&
vol
);
ok
(
hr
==
S_OK
,
"GetMasterVolume failed: %08x
\n
"
,
hr
);
ok
(
vol
==
1
.
f
,
"Got wrong volume: %f
\n
"
,
vol
);
ISimpleAudioVolume_Release
(
cap_sav
);
IAudioSessionManager_Release
(
cap_sesm
);
...
...
@@ -2001,7 +2014,6 @@ static void test_session_creation(void)
vol
=
0
.
5
f
;
hr
=
ISimpleAudioVolume_GetMasterVolume
(
cap_sav
,
&
vol
);
ok
(
hr
==
S_OK
,
"GetMasterVolume failed: %08x
\n
"
,
hr
);
ok
(
vol
==
1
.
f
,
"Got wrong volume: %f
\n
"
,
vol
);
ISimpleAudioVolume_Release
(
cap_sav
);
}
...
...
include/winerror.h
View file @
b1821266
...
...
@@ -59,6 +59,7 @@
#define FACILITY_PLA 48
#define FACILITY_FVE 49
#define FACILITY_WINDOWS_DEFENDER 80
#define FACILITY_DIRECT3D11 0x87c
#define SEVERITY_SUCCESS 0
#define SEVERITY_ERROR 1
...
...
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