Alessandro Pignotti : quartz: The filter graph manager should handle GetCurrentPosition itself.
Alexandre Julliard
julliard at winehq.org
Tue Mar 5 12:59:17 CST 2013
Module: wine
Branch: master
Commit: 4910121972cc2efa3a2b031987c4b7b613b79900
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4910121972cc2efa3a2b031987c4b7b613b79900
Author: Alessandro Pignotti <a.pignotti at sssup.it>
Date: Tue Feb 26 14:13:57 2013 +0100
quartz: The filter graph manager should handle GetCurrentPosition itself.
---
dlls/quartz/filtergraph.c | 40 ++++++++++------------------------------
1 files changed, 10 insertions(+), 30 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 53556cf..0a0beba 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -2451,49 +2451,29 @@ static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLON
return hr;
}
-static HRESULT WINAPI FoundCurrentPosition(IFilterGraphImpl *This, IMediaSeeking *seek, DWORD_PTR pposition)
-{
- HRESULT hr;
- LONGLONG pos = 0, *ppos = (LONGLONG*)pposition;
-
- hr = IMediaSeeking_GetCurrentPosition(seek, &pos);
- if (FAILED(hr))
- return hr;
-
- if (*ppos < 0 || pos < *ppos)
- *ppos = pos;
- return hr;
-}
-
static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *pCurrent)
{
IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
- HRESULT hr;
+ LONGLONG time = 0;
if (!pCurrent)
return E_POINTER;
EnterCriticalSection(&This->cs);
- *pCurrent = -1;
- hr = all_renderers_seek(This, FoundCurrentPosition, (DWORD_PTR)pCurrent);
- if (hr == E_NOTIMPL) {
- LONGLONG time = 0;
- if (This->state == State_Running && This->refClock && This->start_time >= 0)
- {
- IReferenceClock_GetTime(This->refClock, &time);
- if (time)
- time -= This->start_time;
- }
- if (This->pause_time > 0)
- time += This->pause_time;
- *pCurrent = time;
- hr = S_OK;
+ if (This->state == State_Running && This->refClock && This->start_time >= 0)
+ {
+ IReferenceClock_GetTime(This->refClock, &time);
+ if (time)
+ time -= This->start_time;
}
+ if (This->pause_time > 0)
+ time += This->pause_time;
+ *pCurrent = time;
LeaveCriticalSection(&This->cs);
TRACE("Time: %u.%03u\n", (DWORD)(*pCurrent / 10000000), (DWORD)((*pCurrent / 10000)%1000));
- return hr;
+ return S_OK;
}
static HRESULT WINAPI MediaSeeking_ConvertTimeFormat(IMediaSeeking *iface, LONGLONG *pTarget,
More information about the wine-cvs
mailing list