Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
cf09b5a8
Commit
cf09b5a8
authored
Jun 29, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Simplify IEnumMediaTypesImpl_Next().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
03840747
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
24 deletions
+15
-24
mediatype.c
dlls/strmbase/mediatype.c
+15
-24
No files found.
dlls/strmbase/mediatype.c
View file @
cf09b5a8
...
...
@@ -172,44 +172,35 @@ static ULONG WINAPI IEnumMediaTypesImpl_Release(IEnumMediaTypes * iface)
return
ref
;
}
static
HRESULT
WINAPI
IEnumMediaTypesImpl_Next
(
IEnumMediaTypes
*
iface
,
ULONG
cMediaTypes
,
AM_MEDIA_TYPE
**
ppMediaTypes
,
ULONG
*
pcFetched
)
static
HRESULT
WINAPI
IEnumMediaTypesImpl_Next
(
IEnumMediaTypes
*
iface
,
ULONG
count
,
AM_MEDIA_TYPE
**
mts
,
ULONG
*
ret_count
)
{
ULONG
cFetched
;
IEnumMediaTypesImpl
*
This
=
impl_from_IEnumMediaTypes
(
iface
);
TRACE
(
"(%p)->(%u, %p, %p)
\n
"
,
iface
,
cMediaTypes
,
ppMediaTypes
,
pcFetched
);
IEnumMediaTypesImpl
*
enummt
=
impl_from_IEnumMediaTypes
(
iface
);
ULONG
i
;
cFetched
=
min
(
This
->
count
,
This
->
uIndex
+
cMediaTypes
)
-
This
->
uIndex
;
TRACE
(
"iface %p, count %u, mts %p, ret_count %p.
\n
"
,
iface
,
count
,
mts
,
ret_count
)
;
if
(
This
->
currentVersion
!=
This
->
mediaVersionFunction
(
This
->
basePin
))
if
(
enummt
->
currentVersion
!=
enummt
->
mediaVersionFunction
(
enummt
->
basePin
))
return
VFW_E_ENUM_OUT_OF_SYNC
;
TRACE
(
"Next uIndex: %u, cFetched: %u
\n
"
,
This
->
uIndex
,
cFetched
);
if
(
cFetched
>
0
)
for
(
i
=
0
;
i
<
count
&&
enummt
->
uIndex
+
i
<
enummt
->
count
;
i
++
)
{
ULONG
i
;
for
(
i
=
0
;
i
<
cFetched
;
i
++
)
{
if
(
!
(
ppMediaTypes
[
i
]
=
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
)))
||
FAILED
(
This
->
enumMediaFunction
(
This
->
basePin
,
This
->
uIndex
+
i
,
ppMediaTypes
[
i
])))
if
(
!
(
mts
[
i
]
=
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
)))
||
FAILED
(
enummt
->
enumMediaFunction
(
enummt
->
basePin
,
enummt
->
uIndex
+
i
,
mts
[
i
])))
{
while
(
i
--
)
DeleteMediaType
(
ppMediaType
s
[
i
]);
*
pcFetched
=
0
;
DeleteMediaType
(
mt
s
[
i
]);
*
ret_count
=
0
;
return
E_OUTOFMEMORY
;
}
}
}
if
((
c
MediaTypes
!=
1
)
||
pcFetched
)
*
pcFetched
=
cFetched
;
if
((
c
ount
!=
1
)
||
ret_count
)
*
ret_count
=
i
;
This
->
uIndex
+=
cFetched
;
enummt
->
uIndex
+=
i
;
if
(
cFetched
!=
cMediaTypes
)
return
S_FALSE
;
return
S_OK
;
return
i
==
count
?
S_OK
:
S_FALSE
;
}
static
HRESULT
WINAPI
IEnumMediaTypesImpl_Skip
(
IEnumMediaTypes
*
iface
,
ULONG
cMediaTypes
)
...
...
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