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
d16639d1
Commit
d16639d1
authored
Apr 17, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Apr 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Flux AsyncReader in PullPin_BeginFlush.
parent
33b2f69c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
5 deletions
+39
-5
pin.c
dlls/quartz/pin.c
+39
-5
No files found.
dlls/quartz/pin.c
View file @
d16639d1
...
...
@@ -1357,6 +1357,8 @@ ULONG WINAPI PullPin_Release(IPin * iface)
static
DWORD
WINAPI
PullPin_Thread_Main
(
LPVOID
pv
)
{
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
for
(;;)
SleepEx
(
INFINITE
,
TRUE
);
}
...
...
@@ -1368,7 +1370,6 @@ static void CALLBACK PullPin_Thread_Process(ULONG_PTR iface)
ALLOCATOR_PROPERTIES
allocProps
;
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
EnterCriticalSection
(
This
->
pin
.
pCritSec
);
SetEvent
(
This
->
hEventStateChanged
);
...
...
@@ -1433,13 +1434,37 @@ static void CALLBACK PullPin_Thread_Process(ULONG_PTR iface)
IMediaSample_Release
(
pSample
);
}
while
(
This
->
rtCurrent
<
This
->
rtStop
&&
hr
==
S_OK
&&
!
This
->
stop_playback
);
CoUninitialize
();
EnterCriticalSection
(
This
->
pin
.
pCritSec
);
This
->
state
=
State_Paused
;
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
TRACE
(
"End
\n
"
);
}
static
void
CALLBACK
PullPin_Thread_Flush
(
ULONG_PTR
iface
)
{
PullPin
*
This
=
(
PullPin
*
)
iface
;
IMediaSample
*
pSample
;
EnterCriticalSection
(
This
->
pin
.
pCritSec
);
if
(
This
->
pReader
)
{
/* Flush outstanding samples */
IAsyncReader_BeginFlush
(
This
->
pReader
);
for
(;;)
{
IMemAllocator_GetBuffer
(
This
->
pAlloc
,
&
pSample
,
NULL
,
NULL
,
0
);
if
(
!
pSample
)
break
;
IMediaSample_Release
(
pSample
);
}
IAsyncReader_EndFlush
(
This
->
pReader
);
}
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
}
static
void
CALLBACK
PullPin_Thread_Pause
(
ULONG_PTR
iface
)
{
PullPin
*
This
=
(
PullPin
*
)
iface
;
...
...
@@ -1454,7 +1479,6 @@ static void CALLBACK PullPin_Thread_Pause(ULONG_PTR iface)
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
}
static
void
CALLBACK
PullPin_Thread_Stop
(
ULONG_PTR
iface
)
{
PullPin
*
This
=
(
PullPin
*
)
iface
;
...
...
@@ -1477,6 +1501,7 @@ static void CALLBACK PullPin_Thread_Stop(ULONG_PTR iface)
IBaseFilter_Release
(
This
->
pin
.
pinInfo
.
pFilter
);
CoUninitialize
();
ExitThread
(
0
);
}
...
...
@@ -1567,8 +1592,8 @@ HRESULT PullPin_StopProcessing(PullPin * This)
{
TRACE
(
"(%p)->()
\n
"
,
This
);
/* if we are
connected
*/
if
(
This
->
pAlloc
&&
This
->
hThread
)
/* if we are
alive
*/
if
(
This
->
hThread
)
{
PullPin_WaitForStateChange
(
This
,
INFINITE
);
...
...
@@ -1613,6 +1638,15 @@ HRESULT WINAPI PullPin_BeginFlush(IPin * iface)
PullPin_PauseProcessing
(
This
);
PullPin_WaitForStateChange
(
This
,
INFINITE
);
/* Workaround: The file async reader only cancels io on current thread
* only vista and newer have CancelIoEx, so try the thread context if available
* Anyone has some documentation on NtCancelFileIoEx?
*/
if
(
This
->
hThread
)
QueueUserAPC
(
PullPin_Thread_Flush
,
This
->
hThread
,
(
ULONG_PTR
)
This
);
else
PullPin_Thread_Flush
((
ULONG_PTR
)
This
);
}
LeaveCriticalSection
(
&
This
->
thread_lock
);
...
...
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