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
0caef9e2
Commit
0caef9e2
authored
Mar 14, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Mar 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Rewrite OpenFile flow in a more readable manner by using SUCCEEDED macro.
parent
c0610daf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
41 deletions
+24
-41
amstream.c
dlls/amstream/amstream.c
+24
-41
No files found.
dlls/amstream/amstream.c
View file @
0caef9e2
...
...
@@ -303,11 +303,11 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
static
HRESULT
WINAPI
IAMMultiMediaStreamImpl_OpenFile
(
IAMMultiMediaStream
*
iface
,
LPCWSTR
pszFileName
,
DWORD
dwFlags
)
{
HRESULT
ret
;
IAMMultiMediaStreamImpl
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
IFileSourceFilter
*
SourceFilter
;
IBaseFilter
*
BaseFilter
;
IEnumPins
*
EnumPins
;
HRESULT
ret
=
S_OK
;
IFileSourceFilter
*
SourceFilter
=
NULL
;
IBaseFilter
*
BaseFilter
=
NULL
;
IEnumPins
*
EnumPins
=
NULL
;
IPin
*
ipin
;
PIN_DIRECTION
pin_direction
;
...
...
@@ -315,56 +315,39 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac
/* If Initialize was not called before, we do it here */
if
(
!
This
->
pFilterGraph
)
{
ret
=
IAMMultiMediaStream_Initialize
(
iface
,
STREAMTYPE_READ
,
0
,
NULL
);
if
(
FAILED
(
ret
))
return
ret
;
}
ret
=
CoCreateInstance
(
&
CLSID_AsyncReader
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileSourceFilter
,
(
void
**
)
&
SourceFilter
);
if
(
ret
!=
S_OK
)
return
ret
;
if
(
SUCCEEDED
(
ret
))
ret
=
CoCreateInstance
(
&
CLSID_AsyncReader
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileSourceFilter
,
(
void
**
)
&
SourceFilter
);
ret
=
IGraphBuilder_AddSourceFilter
(
This
->
pFilterGraph
,
pszFileName
,
pszFileName
,
&
BaseFilter
);
if
(
FAILED
(
ret
))
goto
end
;
if
(
SUCCEEDED
(
ret
))
ret
=
IGraphBuilder_AddSourceFilter
(
This
->
pFilterGraph
,
pszFileName
,
pszFileName
,
&
BaseFilter
);
ret
=
IFileSourceFilter_Load
(
SourceFilter
,
pszFileName
,
NULL
);
if
(
ret
!=
S_OK
)
{
IFileSourceFilter_Release
(
SourceFilter
);
return
ret
;
}
if
(
SUCCEEDED
(
ret
))
ret
=
IFileSourceFilter_Load
(
SourceFilter
,
pszFileName
,
NULL
);
ret
=
IFileSourceFilter_QueryInterface
(
SourceFilter
,
&
IID_IBaseFilter
,
(
void
**
)
&
BaseFilter
);
if
(
ret
!=
S_OK
)
{
IFileSourceFilter_Release
(
SourceFilter
);
return
ret
;
}
if
(
SUCCEEDED
(
ret
))
ret
=
IFileSourceFilter_QueryInterface
(
SourceFilter
,
&
IID_IBaseFilter
,
(
void
**
)
&
BaseFilter
);
ret
=
IBaseFilter_EnumPins
(
BaseFilter
,
&
EnumPins
);
if
(
ret
!=
S_OK
)
{
goto
end
;
}
if
(
SUCCEEDED
(
ret
))
ret
=
IBaseFilter_EnumPins
(
BaseFilter
,
&
EnumPins
);
if
(
SUCCEEDED
(
ret
))
ret
=
IEnumPins_Next
(
EnumPins
,
1
,
&
ipin
,
NULL
);
ret
=
IEnumPins_Next
(
EnumPins
,
1
,
&
ipin
,
NULL
);
if
(
ret
==
S_OK
)
if
(
SUCCEEDED
(
ret
))
{
ret
=
IPin_QueryDirection
(
ipin
,
&
pin_direction
);
IEnumPins_Release
(
EnumPins
);
if
(
ret
==
S_OK
&&
pin_direction
==
PINDIR_OUTPUT
)
This
->
ipin
=
ipin
;
}
else
{
IEnumPins_Release
(
EnumPins
);
}
end:
IBaseFilter_Release
(
BaseFilter
);
IFileSourceFilter_Release
(
SourceFilter
);
if
(
EnumPins
)
IEnumPins_Release
(
EnumPins
);
if
(
BaseFilter
)
IBaseFilter_Release
(
BaseFilter
);
if
(
SourceFilter
)
IFileSourceFilter_Release
(
SourceFilter
);
return
ret
;
}
...
...
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