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
c28b5345
Commit
c28b5345
authored
Apr 03, 2007
by
Chris Robinson
Committed by
Alexandre Julliard
Apr 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Hold a reference on the PullPin's filter while the processing thread is alive.
Also removes dead code caused by the change.
parent
99c03352
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
27 deletions
+10
-27
pin.c
dlls/quartz/pin.c
+10
-27
No files found.
dlls/quartz/pin.c
View file @
c28b5345
...
...
@@ -1121,15 +1121,6 @@ HRESULT WINAPI PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const
return
hr
;
}
static
void
CALLBACK
PullPin_SafeThreadStop
(
ULONG_PTR
handle
)
{
HANDLE
hThread
=
(
HANDLE
)
handle
;
if
(
hThread
)
CloseHandle
(
hThread
);
ExitThread
(
0
);
}
HRESULT
WINAPI
PullPin_QueryInterface
(
IPin
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
)
{
PullPin
*
This
=
(
PullPin
*
)
iface
;
...
...
@@ -1163,15 +1154,6 @@ ULONG WINAPI PullPin_Release(IPin * iface)
if
(
!
refCount
)
{
if
(
This
->
hThread
)
{
HRESULT
hr
;
if
(
!
QueueUserAPC
(
PullPin_SafeThreadStop
,
This
->
hThread
,
(
ULONG_PTR
)
This
->
hThread
))
ERR
(
"Cannot stop PullPin thread (GetLastError() = %d)!"
,
GetLastError
());
if
(
This
->
pAlloc
&&
FAILED
(
hr
=
IMemAllocator_Decommit
(
This
->
pAlloc
)))
ERR
(
"Allocator decommit failed with error %x. Possible memory leak
\n
"
,
hr
);
}
if
(
This
->
pAlloc
)
IMemAllocator_Release
(
This
->
pAlloc
);
if
(
This
->
pReader
)
...
...
@@ -1195,7 +1177,6 @@ static void CALLBACK PullPin_Thread_Process(ULONG_PTR iface)
HRESULT
hr
;
ALLOCATOR_PROPERTIES
allocProps
;
PIN_INFO
pinInfo
;
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
...
...
@@ -1218,8 +1199,6 @@ static void CALLBACK PullPin_Thread_Process(ULONG_PTR iface)
REFERENCE_TIME
rtSampleStop
;
DWORD_PTR
dwUser
;
pinInfo
.
pFilter
=
NULL
;
TRACE
(
"Process sample
\n
"
);
hr
=
IMemAllocator_GetBuffer
(
This
->
pAlloc
,
&
pSample
,
NULL
,
NULL
,
0
);
...
...
@@ -1241,9 +1220,6 @@ static void CALLBACK PullPin_Thread_Process(ULONG_PTR iface)
hr
=
IAsyncReader_WaitForNext
(
This
->
pReader
,
10000
,
&
pSample
,
&
dwUser
);
if
(
SUCCEEDED
(
hr
))
hr
=
IPin_QueryPinInfo
((
IPin
*
)
&
This
->
pin
,
&
pinInfo
);
if
(
SUCCEEDED
(
hr
))
{
rtSampleStop
=
rtSampleStart
+
MEDIATIME_FROM_BYTES
(
IMediaSample_GetActualDataLength
(
pSample
));
if
(
rtSampleStop
>
This
->
rtStop
)
...
...
@@ -1256,8 +1232,6 @@ static void CALLBACK PullPin_Thread_Process(ULONG_PTR iface)
else
ERR
(
"Processing error: %x
\n
"
,
hr
);
if
(
pinInfo
.
pFilter
)
IBaseFilter_Release
(
pinInfo
.
pFilter
);
if
(
pSample
)
IMediaSample_Release
(
pSample
);
}
...
...
@@ -1286,6 +1260,8 @@ static void CALLBACK PullPin_Thread_Stop(ULONG_PTR iface)
SetEvent
(
This
->
hEventStateChanged
);
IBaseFilter_Release
(
This
->
pin
.
pinInfo
.
pFilter
);
ExitThread
(
0
);
}
...
...
@@ -1305,9 +1281,16 @@ HRESULT PullPin_InitProcessing(PullPin * This)
DWORD
dwThreadId
;
assert
(
!
This
->
hThread
);
/* AddRef the filter to make sure it and it's pins will be around
* as long as the thread */
IBaseFilter_AddRef
(
This
->
pin
.
pinInfo
.
pFilter
);
This
->
hThread
=
CreateThread
(
NULL
,
0
,
PullPin_Thread_Main
,
NULL
,
0
,
&
dwThreadId
);
if
(
!
This
->
hThread
)
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
IBaseFilter_Release
(
This
->
pin
.
pinInfo
.
pFilter
);
}
if
(
SUCCEEDED
(
hr
))
hr
=
IMemAllocator_Commit
(
This
->
pAlloc
);
...
...
@@ -1329,7 +1312,7 @@ HRESULT PullPin_StartProcessing(PullPin * This)
assert
(
This
->
hThread
);
ResetEvent
(
This
->
hEventStateChanged
);
if
(
!
QueueUserAPC
(
PullPin_Thread_Process
,
This
->
hThread
,
(
ULONG_PTR
)
This
))
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
...
...
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