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
f34efaab
Commit
f34efaab
authored
Aug 07, 2015
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qedit: Simplify/fix the creation of the IEnumMediaTypes.
parent
2d3edce0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
samplegrabber.c
dlls/qedit/samplegrabber.c
+21
-20
No files found.
dlls/qedit/samplegrabber.c
View file @
f34efaab
...
...
@@ -37,7 +37,7 @@ static const WCHAR vendor_name[] = { 'W', 'i', 'n', 'e', 0 };
static
const
WCHAR
pin_in_name
[]
=
{
'I'
,
'n'
,
0
};
static
const
WCHAR
pin_out_name
[]
=
{
'O'
,
'u'
,
't'
,
0
};
static
IEnumMediaTypes
*
mediaenum_create
(
const
AM_MEDIA_TYPE
*
mtype
);
static
IEnumMediaTypes
*
mediaenum_create
(
const
AM_MEDIA_TYPE
*
mtype
,
BOOL
past
);
/* Single media type enumerator */
typedef
struct
_ME_Impl
{
...
...
@@ -151,10 +151,9 @@ static HRESULT WINAPI Single_IEnumMediaTypes_Clone(IEnumMediaTypes *iface, IEnum
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
me
);
if
(
!
me
)
return
E_POINTER
;
*
me
=
mediaenum_create
(
&
This
->
mtype
);
*
me
=
mediaenum_create
(
&
This
->
mtype
,
This
->
past
);
if
(
!*
me
)
return
E_OUTOFMEMORY
;
((
ME_Impl
*
)
*
me
)
->
past
=
This
->
past
;
return
S_OK
;
}
...
...
@@ -172,27 +171,29 @@ static const IEnumMediaTypesVtbl IEnumMediaTypes_VTable =
Single_IEnumMediaTypes_Clone
,
};
static
IEnumMediaTypes
*
mediaenum_create
(
const
AM_MEDIA_TYPE
*
mtype
)
static
IEnumMediaTypes
*
mediaenum_create
(
const
AM_MEDIA_TYPE
*
mtype
,
BOOL
past
)
{
ME_Impl
*
obj
=
CoTaskMemAlloc
(
sizeof
(
ME_Impl
));
if
(
obj
)
{
ZeroMemory
(
obj
,
sizeof
(
ME_Impl
));
obj
->
IEnumMediaTypes_iface
.
lpVtbl
=
&
IEnumMediaTypes_VTable
;
obj
->
refCount
=
1
;
obj
->
past
=
FALSE
;
if
(
mtype
)
{
obj
->
mtype
=
*
mtype
;
obj
->
mtype
.
pUnk
=
NULL
;
if
(
mtype
->
cbFormat
)
{
obj
->
mtype
.
pbFormat
=
CoTaskMemAlloc
(
mtype
->
cbFormat
);
CopyMemory
(
obj
->
mtype
.
pbFormat
,
mtype
->
pbFormat
,
mtype
->
cbFormat
);
}
else
obj
->
mtype
.
pbFormat
=
NULL
;
if
(
!
obj
)
return
NULL
;
ZeroMemory
(
obj
,
sizeof
(
*
obj
));
obj
->
IEnumMediaTypes_iface
.
lpVtbl
=
&
IEnumMediaTypes_VTable
;
obj
->
refCount
=
1
;
obj
->
past
=
past
;
if
(
mtype
)
{
obj
->
mtype
=
*
mtype
;
obj
->
mtype
.
pUnk
=
NULL
;
if
(
mtype
->
cbFormat
)
{
obj
->
mtype
.
pbFormat
=
CoTaskMemAlloc
(
mtype
->
cbFormat
);
CopyMemory
(
obj
->
mtype
.
pbFormat
,
mtype
->
pbFormat
,
mtype
->
cbFormat
);
}
else
obj
->
mtype
.
majortype
=
GUID_
NULL
;
obj
->
mtype
.
pbFormat
=
NULL
;
}
else
obj
->
mtype
.
majortype
=
GUID_NULL
;
return
&
obj
->
IEnumMediaTypes_iface
;
}
...
...
@@ -1095,7 +1096,7 @@ SampleGrabber_IPin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **mtypes)
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
mtypes
);
if
(
!
mtypes
)
return
E_POINTER
;
*
mtypes
=
mediaenum_create
(
This
->
sg
->
pin_in
.
pair
?
&
This
->
sg
->
mtype
:
NULL
);
*
mtypes
=
mediaenum_create
(
This
->
sg
->
pin_in
.
pair
?
&
This
->
sg
->
mtype
:
NULL
,
FALSE
);
return
*
mtypes
?
S_OK
:
E_OUTOFMEMORY
;
}
...
...
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