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
d15c23b3
Commit
d15c23b3
authored
Sep 01, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Sep 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Don't keep track of streams in the multimedia stream object.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6d6ea5dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
28 deletions
+9
-28
multimedia.c
dlls/amstream/multimedia.c
+7
-26
amstream.c
dlls/amstream/tests/amstream.c
+2
-2
No files found.
dlls/amstream/multimedia.c
View file @
d15c23b3
...
...
@@ -39,8 +39,6 @@ struct multimedia_stream
IMediaControl
*
media_control
;
IMediaStreamFilter
*
filter
;
IPin
*
ipin
;
ULONG
nbStreams
;
IAMMediaStream
**
pStreams
;
STREAM_TYPE
StreamType
;
OAEVENT
event
;
};
...
...
@@ -85,15 +83,11 @@ static ULONG WINAPI multimedia_stream_Release(IAMMultiMediaStream *iface)
{
struct
multimedia_stream
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
i
;
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
if
(
!
ref
)
{
for
(
i
=
0
;
i
<
This
->
nbStreams
;
i
++
)
IAMMediaStream_Release
(
This
->
pStreams
[
i
]);
CoTaskMemFree
(
This
->
pStreams
);
if
(
This
->
ipin
)
IPin_Release
(
This
->
ipin
);
IMediaStreamFilter_Release
(
This
->
filter
);
...
...
@@ -291,14 +285,14 @@ static HRESULT WINAPI multimedia_stream_GetFilter(IAMMultiMediaStream *iface,
}
static
HRESULT
WINAPI
multimedia_stream_AddMediaStream
(
IAMMultiMediaStream
*
iface
,
IUnknown
*
stream_object
,
const
MSPID
*
PurposeId
,
DWORD
dwFlags
,
IMediaStream
**
ppNewS
tream
)
IUnknown
*
stream_object
,
const
MSPID
*
PurposeId
,
DWORD
dwFlags
,
IMediaStream
**
ret_s
tream
)
{
struct
multimedia_stream
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
HRESULT
hr
;
IAMMediaStream
*
pStream
;
IAMMediaStream
**
pNewStreams
;
TRACE
(
"(%p/%p)->(%p,%s,%x,%p)
\n
"
,
This
,
iface
,
stream_object
,
debugstr_guid
(
PurposeId
),
dwFlags
,
ppNewStream
);
TRACE
(
"mmstream %p, stream_object %p, id %s, flags %#x, ret_stream %p.
\n
"
,
This
,
stream_object
,
debugstr_guid
(
PurposeId
),
dwFlags
,
ret_stream
);
if
(
!
IsEqualGUID
(
PurposeId
,
&
MSPID_PrimaryVideo
)
&&
!
IsEqualGUID
(
PurposeId
,
&
MSPID_PrimaryAudio
))
return
MS_E_PURPOSEID
;
...
...
@@ -331,28 +325,15 @@ static HRESULT WINAPI multimedia_stream_AddMediaStream(IAMMultiMediaStream *ifac
hr
=
ddrawmediastream_create
((
IMultiMediaStream
*
)
iface
,
PurposeId
,
stream_object
,
This
->
StreamType
,
&
pStream
);
else
hr
=
audiomediastream_create
((
IMultiMediaStream
*
)
iface
,
PurposeId
,
stream_object
,
This
->
StreamType
,
&
pStream
);
if
(
SUCCEEDED
(
hr
))
{
pNewStreams
=
CoTaskMemRealloc
(
This
->
pStreams
,
(
This
->
nbStreams
+
1
)
*
sizeof
(
IAMMediaStream
*
));
if
(
!
pNewStreams
)
{
IAMMediaStream_Release
(
pStream
);
return
E_OUTOFMEMORY
;
}
This
->
pStreams
=
pNewStreams
;
This
->
pStreams
[
This
->
nbStreams
]
=
pStream
;
This
->
nbStreams
++
;
if
(
ppNewStream
)
{
IMediaStream_AddRef
(
*
ppNewStream
=
(
IMediaStream
*
)
pStream
);
}
}
if
(
SUCCEEDED
(
hr
))
{
/* Add stream to the media stream filter */
IMediaStreamFilter_AddMediaStream
(
This
->
filter
,
pStream
);
if
(
ret_stream
)
*
ret_stream
=
(
IMediaStream
*
)
pStream
;
else
IAMMediaStream_Release
(
pStream
);
}
return
hr
;
...
...
dlls/amstream/tests/amstream.c
View file @
d15c23b3
...
...
@@ -1152,7 +1152,7 @@ static void test_enum_pins(void)
ref
=
get_refcount
(
enum1
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pin
);
todo_wine
ok
(
ref
==
4
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
ref
==
4
,
"Got unexpected refcount %d.
\n
"
,
ref
);
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -1162,7 +1162,7 @@ static void test_enum_pins(void)
ref
=
get_refcount
(
enum1
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pin
);
todo_wine
ok
(
ref
==
5
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
ref
==
5
,
"Got unexpected refcount %d.
\n
"
,
ref
);
IPin_Release
(
pins
[
0
]);
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
...
...
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