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
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
...
@@ -303,11 +303,11 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
static
HRESULT
WINAPI
IAMMultiMediaStreamImpl_OpenFile
(
IAMMultiMediaStream
*
iface
,
LPCWSTR
pszFileName
,
DWORD
dwFlags
)
static
HRESULT
WINAPI
IAMMultiMediaStreamImpl_OpenFile
(
IAMMultiMediaStream
*
iface
,
LPCWSTR
pszFileName
,
DWORD
dwFlags
)
{
{
HRESULT
ret
;
IAMMultiMediaStreamImpl
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
IAMMultiMediaStreamImpl
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
IFileSourceFilter
*
SourceFilter
;
HRESULT
ret
=
S_OK
;
IBaseFilter
*
BaseFilter
;
IFileSourceFilter
*
SourceFilter
=
NULL
;
IEnumPins
*
EnumPins
;
IBaseFilter
*
BaseFilter
=
NULL
;
IEnumPins
*
EnumPins
=
NULL
;
IPin
*
ipin
;
IPin
*
ipin
;
PIN_DIRECTION
pin_direction
;
PIN_DIRECTION
pin_direction
;
...
@@ -315,56 +315,39 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac
...
@@ -315,56 +315,39 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac
/* If Initialize was not called before, we do it here */
/* If Initialize was not called before, we do it here */
if
(
!
This
->
pFilterGraph
)
if
(
!
This
->
pFilterGraph
)
{
ret
=
IAMMultiMediaStream_Initialize
(
iface
,
STREAMTYPE_READ
,
0
,
NULL
);
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
(
SUCCEEDED
(
ret
))
if
(
ret
!=
S_OK
)
ret
=
CoCreateInstance
(
&
CLSID_AsyncReader
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileSourceFilter
,
(
void
**
)
&
SourceFilter
);
return
ret
;
ret
=
IGraphBuilder_AddSourceFilter
(
This
->
pFilterGraph
,
pszFileName
,
pszFileName
,
&
BaseFilter
);
if
(
SUCCEEDED
(
ret
))
if
(
FAILED
(
ret
))
ret
=
IGraphBuilder_AddSourceFilter
(
This
->
pFilterGraph
,
pszFileName
,
pszFileName
,
&
BaseFilter
);
goto
end
;
ret
=
IFileSourceFilter_Load
(
SourceFilter
,
pszFileName
,
NULL
);
if
(
SUCCEEDED
(
ret
))
if
(
ret
!=
S_OK
)
ret
=
IFileSourceFilter_Load
(
SourceFilter
,
pszFileName
,
NULL
);
{
IFileSourceFilter_Release
(
SourceFilter
);
return
ret
;
}
ret
=
IFileSourceFilter_QueryInterface
(
SourceFilter
,
&
IID_IBaseFilter
,
(
void
**
)
&
BaseFilter
);
if
(
SUCCEEDED
(
ret
))
if
(
ret
!=
S_OK
)
ret
=
IFileSourceFilter_QueryInterface
(
SourceFilter
,
&
IID_IBaseFilter
,
(
void
**
)
&
BaseFilter
);
{
IFileSourceFilter_Release
(
SourceFilter
);
return
ret
;
}
ret
=
IBaseFilter_EnumPins
(
BaseFilter
,
&
EnumPins
);
if
(
SUCCEEDED
(
ret
))
if
(
ret
!=
S_OK
)
ret
=
IBaseFilter_EnumPins
(
BaseFilter
,
&
EnumPins
);
{
goto
end
;
if
(
SUCCEEDED
(
ret
))
}
ret
=
IEnumPins_Next
(
EnumPins
,
1
,
&
ipin
,
NULL
);
ret
=
IEnumPins_Next
(
EnumPins
,
1
,
&
ipin
,
NULL
);
if
(
SUCCEEDED
(
ret
))
if
(
ret
==
S_OK
)
{
{
ret
=
IPin_QueryDirection
(
ipin
,
&
pin_direction
);
ret
=
IPin_QueryDirection
(
ipin
,
&
pin_direction
);
IEnumPins_Release
(
EnumPins
);
if
(
ret
==
S_OK
&&
pin_direction
==
PINDIR_OUTPUT
)
if
(
ret
==
S_OK
&&
pin_direction
==
PINDIR_OUTPUT
)
This
->
ipin
=
ipin
;
This
->
ipin
=
ipin
;
}
}
else
{
IEnumPins_Release
(
EnumPins
);
}
end:
if
(
EnumPins
)
IBaseFilter_Release
(
BaseFilter
);
IEnumPins_Release
(
EnumPins
);
IFileSourceFilter_Release
(
SourceFilter
);
if
(
BaseFilter
)
IBaseFilter_Release
(
BaseFilter
);
if
(
SourceFilter
)
IFileSourceFilter_Release
(
SourceFilter
);
return
ret
;
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