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
1d90e431
Commit
1d90e431
authored
Dec 16, 2004
by
Christian Costa
Committed by
Alexandre Julliard
Dec 16, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Many fixes to the system clock implementation.
Ensure there is a clock before doing any AddRef or Release in the AVI splitter. Improved tests a bit. Misc fixes and traces clean-up.
parent
b4bb1c93
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
21 deletions
+44
-21
avisplit.c
dlls/quartz/avisplit.c
+4
-2
filtergraph.c
dlls/quartz/filtergraph.c
+3
-3
pin.c
dlls/quartz/pin.c
+1
-1
systemclock.c
dlls/quartz/systemclock.c
+15
-5
filtergraph.c
dlls/quartz/tests/filtergraph.c
+21
-10
No files found.
dlls/quartz/avisplit.c
View file @
1d90e431
...
...
@@ -224,7 +224,8 @@ static ULONG WINAPI AVISplitter_Release(IBaseFilter * iface)
ULONG
i
;
DeleteCriticalSection
(
&
This
->
csFilter
);
IReferenceClock_Release
(
This
->
pClock
);
if
(
This
->
pClock
)
IReferenceClock_Release
(
This
->
pClock
);
for
(
i
=
0
;
i
<
This
->
cStreams
+
1
;
i
++
)
IPin_Release
(
This
->
ppPins
[
i
]);
...
...
@@ -385,7 +386,8 @@ static HRESULT WINAPI AVISplitter_GetSyncSource(IBaseFilter * iface, IReferenceC
EnterCriticalSection
(
&
This
->
csFilter
);
{
*
ppClock
=
This
->
pClock
;
IReferenceClock_AddRef
(
This
->
pClock
);
if
(
This
->
pClock
)
IReferenceClock_AddRef
(
This
->
pClock
);
}
LeaveCriticalSection
(
&
This
->
csFilter
);
...
...
dlls/quartz/filtergraph.c
View file @
1d90e431
...
...
@@ -495,7 +495,7 @@ static HRESULT GetFilterInfo(IMoniker* pMoniker, GUID* pclsid, VARIANT* pvar)
static
const
WCHAR
wszFriendlyName
[]
=
{
'F'
,
'r'
,
'i'
,
'e'
,
'n'
,
'd'
,
'l'
,
'y'
,
'N'
,
'a'
,
'm'
,
'e'
,
0
};
IPropertyBag
*
pPropBagCat
=
NULL
;
HRESULT
hr
;
VariantInit
(
pvar
);
V_VT
(
pvar
)
=
VT_BSTR
;
...
...
@@ -524,7 +524,7 @@ static HRESULT GetInternalConnections(IBaseFilter* pfilter, IPin* poutputpin, IP
HRESULT
hr
;
ULONG
nb
=
0
;
TRACE
(
"
\n
"
);
TRACE
(
"
(%p, %p, %p, %p)
\n
"
,
pfilter
,
poutputpin
,
pppins
,
pnb
);
hr
=
IPin_QueryInternalConnections
(
poutputpin
,
NULL
,
&
nb
);
if
(
hr
==
S_OK
)
{
/* Rendered input */
...
...
@@ -1167,7 +1167,7 @@ static HRESULT WINAPI Mediacontrol_Run(IMediaControl *iface) {
ResetEvent
(
This
->
hEventCompletion
);
return
S_
OK
;
return
S_
FALSE
;
}
static
HRESULT
WINAPI
Mediacontrol_Pause
(
IMediaControl
*
iface
)
{
...
...
dlls/quartz/pin.c
View file @
1d90e431
...
...
@@ -730,7 +730,7 @@ HRESULT WINAPI OutputPin_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDI
}
/* if succeeded */
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
FIXM
E
(
" -- %lx
\n
"
,
hr
);
TRAC
E
(
" -- %lx
\n
"
,
hr
);
return
hr
;
}
...
...
dlls/quartz/systemclock.c
View file @
1d90e431
...
...
@@ -111,16 +111,16 @@ static DWORD WINAPI SystemClockAdviseThread(LPVOID lpParam) {
timeOut
=
INFINITE
;
goto
outrefresh
;
}
/** First SingleShots Advice: sorted list */
for
(
it
=
This
->
pSingleShotAdvise
;
NULL
!=
it
&&
it
->
rtBaseTime
<=
curTime
;
it
=
it
->
next
)
{
for
(
it
=
This
->
pSingleShotAdvise
;
NULL
!=
it
&&
(
it
->
rtBaseTime
+
it
->
rtIntervalTime
)
<=
curTime
;
it
=
it
->
next
)
{
/** send event ... */
SetEvent
((
HANDLE
)
it
->
hEvent
);
/** ... and Release it */
QUARTZ_RemoveAviseEntryFromQueue
(
This
,
it
);
HeapFree
(
GetProcessHeap
(),
0
,
it
);
}
if
(
NULL
!=
it
)
timeOut
=
(
DWORD
)
(
curTime
-
(
it
->
rtBaseTime
+
it
->
rtIntervalTime
))
;
if
(
NULL
!=
it
)
timeOut
=
(
DWORD
)
(
(
it
->
rtBaseTime
+
it
->
rtIntervalTime
)
-
curTime
)
/
(
REFERENCE_TIME
)
10000
;
/** Now Periodics Advice: semi sorted list (sort cannot be used) */
for
(
it
=
This
->
pPeriodicAdvise
;
NULL
!=
it
;
it
=
it
->
next
)
{
...
...
@@ -129,10 +129,10 @@ static DWORD WINAPI SystemClockAdviseThread(LPVOID lpParam) {
/** Release the semaphore ... */
ReleaseSemaphore
((
HANDLE
)
it
->
hEvent
,
nPeriods
,
NULL
);
/** ... and refresh time */
it
->
rtBaseTime
+=
it
->
rtIntervalTime
;
it
->
rtBaseTime
+=
nPeriods
*
it
->
rtIntervalTime
;
/*assert( it->rtBaseTime + it->rtIntervalTime < curTime );*/
}
tmpTimeOut
=
(
DWORD
)
(
curTime
-
(
it
->
rtBaseTime
+
it
->
rtIntervalTime
))
;
tmpTimeOut
=
(
DWORD
)
(
(
it
->
rtBaseTime
+
it
->
rtIntervalTime
)
-
curTime
)
/
(
REFERENCE_TIME
)
10000
;
if
(
timeOut
>
tmpTimeOut
)
timeOut
=
tmpTimeOut
;
}
...
...
@@ -175,10 +175,20 @@ outofthread:
static
BOOL
SystemClockPostMessageToAdviseThread
(
SystemClockImpl
*
This
,
UINT
iMsg
)
{
if
(
FALSE
==
This
->
adviseThreadActive
)
{
BOOL
res
;
This
->
adviseThread
=
CreateThread
(
NULL
,
0
,
SystemClockAdviseThread
,
This
,
0
,
&
This
->
adviseThreadId
);
if
(
NULL
==
This
->
adviseThread
)
return
FALSE
;
SetThreadPriority
(
This
->
adviseThread
,
THREAD_PRIORITY_TIME_CRITICAL
);
This
->
adviseThreadActive
=
TRUE
;
while
(
1
)
{
res
=
PostThreadMessageA
(
This
->
adviseThreadId
,
iMsg
,
0
,
0
);
/* Let the thread creates its message queue (with MsgWaitForMultipleObjects call) by yielding and retrying */
if
(
!
res
&&
(
GetLastError
()
==
ERROR_INVALID_THREAD_ID
))
Sleep
(
0
);
else
break
;
}
return
res
;
}
return
PostThreadMessageA
(
This
->
adviseThreadId
,
iMsg
,
0
,
0
);
}
...
...
dlls/quartz/tests/filtergraph.c
View file @
1d90e431
...
...
@@ -27,6 +27,8 @@
#include "dshow.h"
#include "control.h"
static
const
WCHAR
file
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
'a'
,
'v'
,
'i'
,
0
};
IGraphBuilder
*
pgraph
;
static
void
createfiltergraph
()
...
...
@@ -37,10 +39,8 @@ static void createfiltergraph()
ok
(
hr
==
S_OK
,
"Creating filtergraph returned: %lx
\n
"
,
hr
);
}
#if 0
static
void
renderfile
()
{
WCHAR file[] = {'t','e','s','t','.','a','v','i',0};
HRESULT
hr
;
hr
=
IGraphBuilder_RenderFile
(
pgraph
,
file
,
NULL
);
...
...
@@ -56,27 +56,38 @@ static void rungraph()
ok
(
hr
==
S_OK
,
"Cannot get IMediaControl interface returned: %lx
\n
"
,
hr
);
hr
=
IMediaControl_Run
(
pmc
);
ok(hr==S_OK, "Cannot run the graph returned: %lx\n", hr);
ok
(
hr
==
S_FALSE
,
"Cannot run the graph returned: %lx
\n
"
,
hr
);
Sleep
(
20000
);
Sleep(20000);
hr
=
IMediaControl_Stop
(
pmc
);
ok
(
hr
==
S_OK
,
"Cannot stop the graph returned: %lx
\n
"
,
hr
);
hr
=
IMediaControl_Release
(
pmc
);
ok
(
hr
==
1
,
"Releasing mediacontrol returned: %lx
\n
"
,
hr
);
}
#endif
static
void
releasefiltergraph
()
{
HRESULT
hr
;
hr
=
IGraphBuilder_Release
(
pgraph
);
ok
(
hr
==
S_OK
,
"Releasing filtergraph returned: %lx
\n
"
,
hr
);
ok
(
hr
==
0
,
"Releasing filtergraph returned: %lx
\n
"
,
hr
);
}
START_TEST
(
filtergraph
)
{
HANDLE
h
;
CoInitialize
(
NULL
);
createfiltergraph
();
#if 0
renderfile();
rungraph();
#endif
h
=
CreateFileW
(
file
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
h
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
h
);
renderfile
();
rungraph
();
}
releasefiltergraph
();
}
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