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
5b612c30
Commit
5b612c30
authored
Jun 16, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/parser: Share sink pin and filter reference counts.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5f08add0
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
44 deletions
+31
-44
parser.c
dlls/quartz/parser.c
+2
-11
pin.c
dlls/quartz/pin.c
+25
-23
pin.h
dlls/quartz/pin.h
+3
-1
avisplit.c
dlls/quartz/tests/avisplit.c
+0
-3
mpegsplit.c
dlls/quartz/tests/mpegsplit.c
+1
-3
waveparser.c
dlls/quartz/tests/waveparser.c
+0
-3
No files found.
dlls/quartz/parser.c
View file @
5b612c30
...
...
@@ -155,7 +155,6 @@ ULONG WINAPI Parser_AddRef(IBaseFilter * iface)
void
Parser_Destroy
(
ParserImpl
*
This
)
{
IPin
*
connected
=
NULL
;
ULONG
pinref
;
HRESULT
hr
;
PullPin_WaitForStateChange
(
This
->
pInputPin
,
INFINITE
);
...
...
@@ -170,16 +169,8 @@ void Parser_Destroy(ParserImpl *This)
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
);
}
PullPin_destroy
(
This
->
pInputPin
);
CoTaskMemFree
(
This
->
ppPins
);
strmbase_filter_cleanup
(
&
This
->
filter
);
...
...
@@ -734,7 +725,7 @@ static HRESULT WINAPI Parser_PullPin_EnumMediaTypes(IPin *iface, IEnumMediaTypes
static
const
IPinVtbl
Parser_InputPin_Vtbl
=
{
Parser_PullPin_QueryInterface
,
BasePinImpl
_AddRef
,
PullPin
_AddRef
,
PullPin_Release
,
BaseInputPinImpl_Connect
,
Parser_PullPin_ReceiveConnection
,
...
...
dlls/quartz/pin.c
View file @
5b612c30
...
...
@@ -364,32 +364,34 @@ HRESULT WINAPI PullPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv)
return
E_NOINTERFACE
;
}
ULONG
WINAPI
PullPin_Release
(
IPin
*
iface
)
void
PullPin_destroy
(
PullPin
*
pin
)
{
PullPin
*
This
=
impl_PullPin_from_IPin
(
iface
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
pin
.
refCount
);
TRACE
(
"(%p)->() Release from %d
\n
"
,
This
,
refCount
+
1
);
WaitForSingleObject
(
pin
->
hEventStateChanged
,
INFINITE
);
assert
(
!
pin
->
hThread
);
if
(
pin
->
prefAlloc
)
IMemAllocator_Release
(
pin
->
prefAlloc
);
if
(
pin
->
pAlloc
)
IMemAllocator_Release
(
pin
->
pAlloc
);
if
(
pin
->
pReader
)
IAsyncReader_Release
(
pin
->
pReader
);
CloseHandle
(
pin
->
thread_sleepy
);
CloseHandle
(
pin
->
hEventStateChanged
);
pin
->
thread_lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
pin
->
thread_lock
);
CoTaskMemFree
(
pin
);
}
if
(
!
refCount
)
{
WaitForSingleObject
(
This
->
hEventStateChanged
,
INFINITE
);
assert
(
!
This
->
hThread
);
ULONG
WINAPI
PullPin_AddRef
(
IPin
*
iface
)
{
PullPin
*
pin
=
impl_PullPin_from_IPin
(
iface
);
return
IBaseFilter_AddRef
(
pin
->
pin
.
pinInfo
.
pFilter
);
}
if
(
This
->
prefAlloc
)
IMemAllocator_Release
(
This
->
prefAlloc
);
if
(
This
->
pAlloc
)
IMemAllocator_Release
(
This
->
pAlloc
);
if
(
This
->
pReader
)
IAsyncReader_Release
(
This
->
pReader
);
CloseHandle
(
This
->
thread_sleepy
);
CloseHandle
(
This
->
hEventStateChanged
);
This
->
thread_lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
thread_lock
);
CoTaskMemFree
(
This
);
return
0
;
}
return
refCount
;
ULONG
WINAPI
PullPin_Release
(
IPin
*
iface
)
{
PullPin
*
pin
=
impl_PullPin_from_IPin
(
iface
);
return
IBaseFilter_Release
(
pin
->
pin
.
pinInfo
.
pFilter
);
}
static
void
PullPin_Flush
(
PullPin
*
This
)
...
...
dlls/quartz/pin.h
View file @
5b612c30
...
...
@@ -106,6 +106,7 @@ HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInf
SAMPLEPROC_PULL
pSampleProc
,
LPVOID
pUserData
,
QUERYACCEPTPROC
pQueryAccept
,
CLEANUPPROC
pCleanUp
,
REQUESTPROC
pCustomRequest
,
STOPPROCESSPROC
pDone
,
LPCRITICAL_SECTION
pCritSec
,
IPin
**
ppPin
);
void
PullPin_destroy
(
PullPin
*
pin
)
DECLSPEC_HIDDEN
;
/**************************/
/*** Pin Implementation ***/
...
...
@@ -114,7 +115,8 @@ HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInf
HRESULT
WINAPI
PullPin_ReceiveConnection
(
IPin
*
iface
,
IPin
*
pReceivePin
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
PullPin_Disconnect
(
IPin
*
iface
);
HRESULT
WINAPI
PullPin_QueryInterface
(
IPin
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
);
ULONG
WINAPI
PullPin_Release
(
IPin
*
iface
);
ULONG
WINAPI
PullPin_AddRef
(
IPin
*
iface
)
DECLSPEC_HIDDEN
;
ULONG
WINAPI
PullPin_Release
(
IPin
*
iface
)
DECLSPEC_HIDDEN
;
HRESULT
WINAPI
PullPin_EndOfStream
(
IPin
*
iface
);
HRESULT
WINAPI
PullPin_QueryAccept
(
IPin
*
iface
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
WINAPI
PullPin_BeginFlush
(
IPin
*
iface
);
...
...
dlls/quartz/tests/avisplit.c
View file @
5b612c30
...
...
@@ -296,10 +296,8 @@ static void test_enum_pins(void)
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
(
filter
);
todo_wine
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pins
[
0
]);
todo_wine
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
enum1
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
...
...
@@ -487,7 +485,6 @@ static void test_pin_info(void)
ref
=
get_refcount
(
filter
);
ok
(
ref
==
expect_ref
+
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pin
);
todo_wine
ok
(
ref
==
expect_ref
+
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
IBaseFilter_Release
(
info
.
pFilter
);
...
...
dlls/quartz/tests/mpegsplit.c
View file @
5b612c30
...
...
@@ -293,10 +293,8 @@ static void test_enum_pins(void)
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
(
filter
);
todo_wine
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pins
[
0
]);
todo_wine
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
enum1
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
...
...
@@ -480,7 +478,7 @@ static void test_pin_info(void)
ref
=
get_refcount
(
filter
);
ok
(
ref
==
expect_ref
+
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pin
);
todo_wine
ok
(
ref
==
expect_ref
+
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
ref
==
expect_ref
+
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
IBaseFilter_Release
(
info
.
pFilter
);
hr
=
IPin_QueryDirection
(
pin
,
&
dir
);
...
...
dlls/quartz/tests/waveparser.c
View file @
5b612c30
...
...
@@ -293,10 +293,8 @@ static void test_enum_pins(void)
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
(
filter
);
todo_wine
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pins
[
0
]);
todo_wine
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
enum1
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
...
...
@@ -480,7 +478,6 @@ static void test_pin_info(void)
ref
=
get_refcount
(
filter
);
ok
(
ref
==
expect_ref
+
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pin
);
todo_wine
ok
(
ref
==
expect_ref
+
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
IBaseFilter_Release
(
info
.
pFilter
);
...
...
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