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
42699ad1
Commit
42699ad1
authored
May 25, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
May 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer/gstdemux: Use BaseFilterImpl_Release().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
912dd6ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
51 deletions
+41
-51
gstdemux.c
dlls/winegstreamer/gstdemux.c
+41
-51
No files found.
dlls/winegstreamer/gstdemux.c
View file @
42699ad1
...
...
@@ -1213,8 +1213,48 @@ static IPin *gstdemux_get_pin(BaseFilter *base, unsigned int index)
return
pin
;
}
static
void
gstdemux_destroy
(
BaseFilter
*
iface
)
{
GSTImpl
*
filter
=
impl_from_IBaseFilter
(
&
iface
->
IBaseFilter_iface
);
IPin
*
connected
=
NULL
;
ULONG
pinref
;
HRESULT
hr
;
CloseHandle
(
filter
->
no_more_pads_event
);
CloseHandle
(
filter
->
push_event
);
/* Don't need to clean up output pins, disconnecting input pin will do that */
IPin_ConnectedTo
((
IPin
*
)
&
filter
->
pInputPin
,
&
connected
);
if
(
connected
)
{
hr
=
IPin_Disconnect
(
connected
);
assert
(
hr
==
S_OK
);
IPin_Release
(
connected
);
hr
=
IPin_Disconnect
(
&
filter
->
pInputPin
.
pin
.
IPin_iface
);
assert
(
hr
==
S_OK
);
}
pinref
=
IPin_Release
(
&
filter
->
pInputPin
.
pin
.
IPin_iface
);
if
(
pinref
)
{
/* Valgrind could find this, if I kill it here */
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
->
bus
)
{
gst_bus_set_sync_handler
(
filter
->
bus
,
NULL
,
NULL
,
NULL
);
gst_object_unref
(
filter
->
bus
);
}
strmbase_filter_cleanup
(
&
filter
->
filter
);
CoTaskMemFree
(
filter
);
}
static
const
BaseFilterFuncTable
BaseFuncTable
=
{
.
filter_get_pin
=
gstdemux_get_pin
,
.
filter_destroy
=
gstdemux_destroy
,
};
IUnknown
*
CALLBACK
Gstreamer_Splitter_create
(
IUnknown
*
pUnkOuter
,
HRESULT
*
phr
)
...
...
@@ -1267,43 +1307,6 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *pUnkOuter, HRESULT *phr)
return
obj
;
}
static
void
GST_Destroy
(
GSTImpl
*
This
)
{
IPin
*
connected
=
NULL
;
ULONG
pinref
;
HRESULT
hr
;
TRACE
(
"Destroying %p
\n
"
,
This
);
CloseHandle
(
This
->
no_more_pads_event
);
CloseHandle
(
This
->
push_event
);
/* Don't need to clean up output pins, disconnecting input pin will do that */
IPin_ConnectedTo
((
IPin
*
)
&
This
->
pInputPin
,
&
connected
);
if
(
connected
)
{
hr
=
IPin_Disconnect
(
connected
);
assert
(
hr
==
S_OK
);
IPin_Release
(
connected
);
hr
=
IPin_Disconnect
(
&
This
->
pInputPin
.
pin
.
IPin_iface
);
assert
(
hr
==
S_OK
);
}
pinref
=
IPin_Release
(
&
This
->
pInputPin
.
pin
.
IPin_iface
);
if
(
pinref
)
{
/* Valgrind could find this, if I kill it here */
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
->
bus
)
{
gst_bus_set_sync_handler
(
This
->
bus
,
NULL
,
NULL
,
NULL
);
gst_object_unref
(
This
->
bus
);
}
strmbase_filter_cleanup
(
&
This
->
filter
);
CoTaskMemFree
(
This
);
}
static
HRESULT
WINAPI
GST_QueryInterface
(
IBaseFilter
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
)
{
GSTImpl
*
This
=
impl_from_IBaseFilter
(
iface
);
...
...
@@ -1332,19 +1335,6 @@ static HRESULT WINAPI GST_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
GST_Release
(
IBaseFilter
*
iface
)
{
GSTImpl
*
This
=
impl_from_IBaseFilter
(
iface
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
filter
.
refCount
);
TRACE
(
"(%p)->() Release from %d
\n
"
,
This
,
refCount
+
1
);
if
(
!
refCount
)
GST_Destroy
(
This
);
return
refCount
;
}
static
HRESULT
WINAPI
GST_Stop
(
IBaseFilter
*
iface
)
{
GSTImpl
*
This
=
impl_from_IBaseFilter
(
iface
);
...
...
@@ -1468,7 +1458,7 @@ static HRESULT WINAPI GST_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout,
static
const
IBaseFilterVtbl
GST_Vtbl
=
{
GST_QueryInterface
,
BaseFilterImpl_AddRef
,
GST
_Release
,
BaseFilterImpl
_Release
,
BaseFilterImpl_GetClassID
,
GST_Stop
,
GST_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