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
6cb835f8
Commit
6cb835f8
authored
Mar 04, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Forbid changing the multimedia stream mode.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fa62cde3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
multimedia.c
dlls/amstream/multimedia.c
+8
-0
amstream.c
dlls/amstream/tests/amstream.c
+11
-11
No files found.
dlls/amstream/multimedia.c
View file @
6cb835f8
...
...
@@ -39,6 +39,7 @@ struct multimedia_stream
IMediaControl
*
media_control
;
IMediaStreamFilter
*
filter
;
IPin
*
ipin
;
BOOL
initialized
;
STREAM_TYPE
type
;
OAEVENT
event
;
};
...
...
@@ -250,10 +251,17 @@ static HRESULT WINAPI multimedia_stream_Initialize(IAMMultiMediaStream *iface,
return
E_INVALIDARG
;
}
if
(
mmstream
->
initialized
&&
type
!=
mmstream
->
type
)
{
WARN
(
"Attempt to change type from %u, returning E_INVALIDARG.
\n
"
,
mmstream
->
type
);
return
E_INVALIDARG
;
}
if
(
graph
&&
FAILED
(
hr
=
create_graph
(
mmstream
,
graph
)))
return
hr
;
mmstream
->
type
=
type
;
mmstream
->
initialized
=
TRUE
;
return
S_OK
;
}
...
...
dlls/amstream/tests/amstream.c
View file @
6cb835f8
...
...
@@ -1497,9 +1497,9 @@ static void test_initialize(void)
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_WRITE
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_TRANSFORM
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ret_graph
=
(
IGraphBuilder
*
)
0xdeadbeef
;
hr
=
IAMMultiMediaStream_GetFilterGraph
(
mmstream
,
&
ret_graph
);
...
...
@@ -1511,7 +1511,7 @@ static void test_initialize(void)
type
=
0xdeadbeef
;
hr
=
IMediaStream_GetInformation
(
stream
,
NULL
,
&
type
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
type
==
STREAMTYPE_READ
,
"Got type %u.
\n
"
,
type
);
ok
(
type
==
STREAMTYPE_READ
,
"Got type %u.
\n
"
,
type
);
IMediaStream_Release
(
stream
);
ret_graph
=
NULL
;
...
...
@@ -1531,9 +1531,9 @@ static void test_initialize(void)
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_WRITE
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_TRANSFORM
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ret_graph
=
(
IGraphBuilder
*
)
0xdeadbeef
;
hr
=
IAMMultiMediaStream_GetFilterGraph
(
mmstream
,
&
ret_graph
);
...
...
@@ -1545,7 +1545,7 @@ static void test_initialize(void)
type
=
0xdeadbeef
;
hr
=
IMediaStream_GetInformation
(
stream
,
NULL
,
&
type
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
type
==
STREAMTYPE_WRITE
,
"Got type %u.
\n
"
,
type
);
ok
(
type
==
STREAMTYPE_WRITE
,
"Got type %u.
\n
"
,
type
);
IMediaStream_Release
(
stream
);
ref
=
IAMMultiMediaStream_Release
(
mmstream
);
...
...
@@ -1559,9 +1559,9 @@ static void test_initialize(void)
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_TRANSFORM
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_WRITE
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ret_graph
=
(
IGraphBuilder
*
)
0xdeadbeef
;
hr
=
IAMMultiMediaStream_GetFilterGraph
(
mmstream
,
&
ret_graph
);
...
...
@@ -1573,7 +1573,7 @@ static void test_initialize(void)
type
=
0xdeadbeef
;
hr
=
IMediaStream_GetInformation
(
stream
,
NULL
,
&
type
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
type
==
STREAMTYPE_TRANSFORM
,
"Got type %u.
\n
"
,
type
);
ok
(
type
==
STREAMTYPE_TRANSFORM
,
"Got type %u.
\n
"
,
type
);
IMediaStream_Release
(
stream
);
ref
=
IAMMultiMediaStream_Release
(
mmstream
);
...
...
@@ -1651,9 +1651,9 @@ static void test_initialize(void)
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_WRITE
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_TRANSFORM
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
IMediaStreamFilter_Release
(
filter
);
ref
=
IAMMultiMediaStream_Release
(
mmstream
);
...
...
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