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
fefdc323
Commit
fefdc323
authored
May 25, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
May 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineqtdecoder/qtsplitter: Use BaseFilterImpl_Release().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
42699ad1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
73 deletions
+60
-73
qtsplitter.c
dlls/wineqtdecoder/qtsplitter.c
+60
-73
No files found.
dlls/wineqtdecoder/qtsplitter.c
View file @
fefdc323
...
...
@@ -233,8 +233,67 @@ static IPin *qt_splitter_get_pin(BaseFilter *base, unsigned int index)
return
NULL
;
}
static
void
qt_splitter_destroy
(
BaseFilter
*
iface
)
{
QTSplitter
*
filter
=
impl_from_BaseFilter
(
iface
);
IPin
*
peer
=
NULL
;
ULONG
pinref
;
EnterCriticalSection
(
&
filter
->
csReceive
);
/* Don't need to clean up output pins, disconnecting input pin will do that */
IPin_ConnectedTo
(
&
filter
->
pInputPin
.
pin
.
IPin_iface
,
&
peer
);
if
(
peer
)
{
IPin_Disconnect
(
peer
);
IPin_Release
(
peer
);
}
pinref
=
IPin_Release
(
&
filter
->
pInputPin
.
pin
.
IPin_iface
);
if
(
pinref
)
{
ERR
(
"pinref should be null, is %u, destroying anyway
\n
"
,
pinref
);
assert
((
LONG
)
pinref
>
0
);
while
(
pinref
)
pinref
=
IPin_Release
(
&
filter
->
pInputPin
.
pin
.
IPin_iface
);
}
if
(
filter
->
pQTMovie
)
{
DisposeMovie
(
filter
->
pQTMovie
);
filter
->
pQTMovie
=
NULL
;
}
if
(
filter
->
vContext
)
QTVisualContextRelease
(
filter
->
vContext
);
if
(
filter
->
aSession
)
MovieAudioExtractionEnd
(
filter
->
aSession
);
ExitMoviesOnThread
();
LeaveCriticalSection
(
&
filter
->
csReceive
);
if
(
filter
->
loaderThread
)
{
WaitForSingleObject
(
filter
->
loaderThread
,
INFINITE
);
CloseHandle
(
filter
->
loaderThread
);
}
if
(
filter
->
splitterThread
)
{
SetEvent
(
filter
->
runEvent
);
WaitForSingleObject
(
filter
->
splitterThread
,
INFINITE
);
CloseHandle
(
filter
->
splitterThread
);
}
CloseHandle
(
filter
->
runEvent
);
filter
->
csReceive
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
filter
->
csReceive
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
CoTaskMemFree
(
filter
);
}
static
const
BaseFilterFuncTable
BaseFuncTable
=
{
.
filter_get_pin
=
qt_splitter_get_pin
,
.
filter_destroy
=
qt_splitter_destroy
,
};
IUnknown
*
CALLBACK
QTSplitter_create
(
IUnknown
*
punkout
,
HRESULT
*
phr
)
...
...
@@ -283,65 +342,6 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *punkout, HRESULT *phr)
return
obj
;
}
static
void
QT_Destroy
(
QTSplitter
*
This
)
{
IPin
*
connected
=
NULL
;
ULONG
pinref
;
TRACE
(
"Destroying
\n
"
);
EnterCriticalSection
(
&
This
->
csReceive
);
/* Don't need to clean up output pins, disconnecting input pin will do that */
IPin_ConnectedTo
(
&
This
->
pInputPin
.
pin
.
IPin_iface
,
&
connected
);
if
(
connected
)
{
IPin_Disconnect
(
connected
);
IPin_Release
(
connected
);
}
pinref
=
IPin_Release
(
&
This
->
pInputPin
.
pin
.
IPin_iface
);
if
(
pinref
)
{
ERR
(
"pinref should be null, is %u, destroying anyway
\n
"
,
pinref
);
assert
((
LONG
)
pinref
>
0
);
while
(
pinref
)
pinref
=
IPin_Release
(
&
This
->
pInputPin
.
pin
.
IPin_iface
);
}
if
(
This
->
pQTMovie
)
{
DisposeMovie
(
This
->
pQTMovie
);
This
->
pQTMovie
=
NULL
;
}
if
(
This
->
vContext
)
QTVisualContextRelease
(
This
->
vContext
);
if
(
This
->
aSession
)
MovieAudioExtractionEnd
(
This
->
aSession
);
ExitMoviesOnThread
();
LeaveCriticalSection
(
&
This
->
csReceive
);
if
(
This
->
loaderThread
)
{
WaitForSingleObject
(
This
->
loaderThread
,
INFINITE
);
CloseHandle
(
This
->
loaderThread
);
}
if
(
This
->
splitterThread
)
{
SetEvent
(
This
->
runEvent
);
WaitForSingleObject
(
This
->
splitterThread
,
INFINITE
);
CloseHandle
(
This
->
splitterThread
);
}
CloseHandle
(
This
->
runEvent
);
This
->
csReceive
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
csReceive
);
strmbase_filter_cleanup
(
&
This
->
filter
);
CoTaskMemFree
(
This
);
}
static
HRESULT
WINAPI
QT_QueryInterface
(
IBaseFilter
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
)
{
QTSplitter
*
This
=
impl_from_IBaseFilter
(
iface
);
...
...
@@ -373,19 +373,6 @@ static HRESULT WINAPI QT_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
QT_Release
(
IBaseFilter
*
iface
)
{
QTSplitter
*
This
=
impl_from_IBaseFilter
(
iface
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
filter
.
refCount
);
TRACE
(
"(%p)->() Release from %d
\n
"
,
This
,
refCount
+
1
);
if
(
!
refCount
)
QT_Destroy
(
This
);
return
refCount
;
}
static
HRESULT
WINAPI
QT_Stop
(
IBaseFilter
*
iface
)
{
QTSplitter
*
This
=
impl_from_IBaseFilter
(
iface
);
...
...
@@ -791,7 +778,7 @@ static HRESULT WINAPI QT_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout,
static
const
IBaseFilterVtbl
QT_Vtbl
=
{
QT_QueryInterface
,
BaseFilterImpl_AddRef
,
QT
_Release
,
BaseFilterImpl
_Release
,
BaseFilterImpl_GetClassID
,
QT_Stop
,
QT_Pause
,
...
...
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