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
f6a5a3d0
Commit
f6a5a3d0
authored
Oct 21, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/sar: Use advertised type in IsMediaTypeSupported().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
57e30f27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
42 deletions
+25
-42
sar.c
dlls/mf/sar.c
+2
-3
mf.c
dlls/mf/tests/mf.c
+23
-39
No files found.
dlls/mf/sar.c
View file @
f6a5a3d0
...
...
@@ -1479,11 +1479,10 @@ static HRESULT WINAPI audio_renderer_stream_type_handler_IsMediaTypeSupported(IM
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
in_type
,
out_type
);
EnterCriticalSection
(
&
renderer
->
cs
);
hr
=
renderer
->
current_media_type
&&
IMFMediaType_IsEqual
(
renderer
->
current_media_type
,
in_type
,
&
flags
)
==
S_OK
?
S_OK
:
MF_E_INVALIDMEDIATYPE
;
hr
=
IMFMediaType_IsEqual
(
renderer
->
media_type
,
in_type
,
&
flags
);
LeaveCriticalSection
(
&
renderer
->
cs
);
return
hr
;
return
hr
!=
S_OK
?
MF_E_INVALIDMEDIATYPE
:
hr
;
}
static
HRESULT
WINAPI
audio_renderer_stream_type_handler_GetMediaTypeCount
(
IMFMediaTypeHandler
*
iface
,
DWORD
*
count
)
...
...
dlls/mf/tests/mf.c
View file @
f6a5a3d0
...
...
@@ -2831,7 +2831,7 @@ static void test_sar(void)
IMFMediaSink
*
sink
,
*
sink2
;
IMFStreamSink
*
stream_sink
;
IMFAttributes
*
attributes
;
DWORD
id
,
flags
,
count
;
DWORD
i
,
i
d
,
flags
,
count
;
IMFActivate
*
activate
;
MFCLOCK_STATE
state
;
IMFClock
*
clock
;
...
...
@@ -2839,6 +2839,7 @@ static void test_sar(void)
HRESULT
hr
;
GUID
guid
;
BOOL
mute
;
int
found
;
hr
=
CoInitialize
(
NULL
);
ok
(
hr
==
S_OK
,
"Failed to initialize, hr %#x.
\n
"
,
hr
);
...
...
@@ -2988,6 +2989,22 @@ todo_wine
ok
(
hr
==
S_OK
,
"Failed to get type count, hr %#x.
\n
"
,
hr
);
ok
(
!!
count
,
"Unexpected type count %u.
\n
"
,
count
);
/* A number of same major/subtype entries are returned, with different degrees of finer format
details. Some incomplete types are not accepted, check that at least one of them is considered supported. */
for
(
i
=
0
,
found
=
-
1
;
i
<
count
;
++
i
)
{
hr
=
IMFMediaTypeHandler_GetMediaTypeByIndex
(
handler
,
i
,
&
mediatype
);
ok
(
hr
==
S_OK
,
"Failed to get media type, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
mediatype
,
NULL
)))
found
=
i
;
IMFMediaType_Release
(
mediatype
);
if
(
found
!=
-
1
)
break
;
}
ok
(
found
!=
-
1
,
"Haven't found a supported type.
\n
"
);
hr
=
IMFMediaTypeHandler_GetCurrentMediaType
(
handler
,
&
mediatype
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -3005,16 +3022,16 @@ todo_wine
hr
=
IMFMediaTypeHandler_SetCurrentMediaType
(
handler
,
mediatype
);
ok
(
hr
==
MF_E_INVALIDMEDIATYPE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_GetMediaTypeByIndex
(
handler
,
0
,
&
mediatype2
);
hr
=
IMFMediaTypeHandler_GetMediaTypeByIndex
(
handler
,
found
,
&
mediatype2
);
ok
(
hr
==
S_OK
,
"Failed to get media type, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_GetMediaTypeByIndex
(
handler
,
0
,
&
mediatype3
);
hr
=
IMFMediaTypeHandler_GetMediaTypeByIndex
(
handler
,
found
,
&
mediatype3
);
ok
(
hr
==
S_OK
,
"Failed to get media type, hr %#x.
\n
"
,
hr
);
ok
(
mediatype2
==
mediatype3
,
"Unexpected instance.
\n
"
);
IMFMediaType_Release
(
mediatype3
);
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
mediatype2
,
NULL
);
ok
(
hr
==
MF_E_INVALIDMEDIATYPE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFMediaType_Release
(
mediatype
);
...
...
@@ -3026,39 +3043,8 @@ todo_wine
ok
(
mediatype
==
mediatype2
,
"Unexpected instance.
\n
"
);
IMFMediaType_Release
(
mediatype
);
/* Type is validated against current type. */
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
mediatype2
,
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFMediaType_Release
(
mediatype2
);
/* Set partial type. */
hr
=
MFCreateMediaType
(
&
mediatype
);
ok
(
hr
==
S_OK
,
"Failed to create media type, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaType_GetGUID
(
mediatype2
,
&
MF_MT_SUBTYPE
,
&
guid
);
ok
(
hr
==
S_OK
,
"Failed to get attribute, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
mediatype
,
&
MF_MT_MAJOR_TYPE
,
&
MFMediaType_Audio
);
ok
(
hr
==
S_OK
,
"Failed to set attribute, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
mediatype
,
&
MF_MT_SUBTYPE
,
&
guid
);
ok
(
hr
==
S_OK
,
"Failed to set attribute, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_SetCurrentMediaType
(
handler
,
mediatype
);
ok
(
hr
==
S_OK
,
"Failed to set current type, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_GetCurrentMediaType
(
handler
,
&
mediatype2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
mediatype
==
mediatype2
,
"Unexpected instance.
\n
"
);
IMFMediaType_Release
(
mediatype2
);
hr
=
IMFMediaType_GetCount
(
mediatype
,
&
count
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
count
==
2
,
"Unexpected attribute count %u.
\n
"
,
count
);
IMFMediaType_Release
(
mediatype
);
/* Reset back to uninitialized state. */
hr
=
IMFMediaTypeHandler_SetCurrentMediaType
(
handler
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -3121,10 +3107,8 @@ todo_wine
IMFAudioStreamVolume_Release
(
stream_volume
);
hr
=
MFGetService
((
IUnknown
*
)
sink
,
&
MR_AUDIO_POLICY_SERVICE
,
&
IID_IMFAudioPolicy
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Failed to get interface, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
unk
);
ok
(
hr
==
S_OK
,
"Failed to get interface, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
/* Shutdown */
EXPECT_REF
(
present_clock
,
2
);
...
...
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