Maarten Lankhorst : quartz: Implement stop position in the filtergraph.

Alexandre Julliard julliard at winehq.org
Thu Apr 10 04:39:24 CDT 2008


Module: wine
Branch: master
Commit: 43f9fff0a0237efa88de16e8a1ba7da9a58b09d3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=43f9fff0a0237efa88de16e8a1ba7da9a58b09d3

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Wed Apr  9 12:00:13 2008 -0700

quartz: Implement stop position in the filtergraph.

---

 dlls/quartz/filtergraph.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 91b872d..94e4003 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -203,6 +203,7 @@ typedef struct _IFilterGraphImpl {
     GUID timeformatseek;
     LONGLONG start_time;
     LONGLONG position;
+    LONGLONG stop_position;
 } IFilterGraphImpl;
 
 static HRESULT WINAPI Filtergraph_QueryInterface(IFilterGraphImpl *This,
@@ -2038,10 +2039,23 @@ static HRESULT WINAPI MediaSeeking_GetDuration(IMediaSeeking *iface,
 static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface,
 						   LONGLONG *pStop) {
     ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
+    HRESULT hr = S_OK;
 
-    FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pStop);
+    TRACE("(%p/%p)->(%p)\n", This, iface, pStop);
 
-    return S_OK;
+    if (!pStop)
+        return E_POINTER;
+
+    EnterCriticalSection(&This->cs);
+    if (This->stop_position < 0)
+        /* Stop position not set, use duration instead */
+        hr = IMediaSeeking_GetDuration(iface, pStop);
+    else
+        *pStop = This->stop_position;
+
+    LeaveCriticalSection(&This->cs);
+
+    return hr;
 }
 
 static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface,
@@ -2116,7 +2130,9 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface,
     else if ((dwCurrentFlags & 0x7) != AM_SEEKING_NoPositioning)
         FIXME("Adjust method %x not handled yet!\n", dwCurrentFlags & 0x7);
 
-    if ((dwStopFlags & 0x7) != AM_SEEKING_NoPositioning)
+    if ((dwStopFlags & 0x7) == AM_SEEKING_AbsolutePositioning)
+        This->stop_position = *pStop;
+    else if ((dwStopFlags & 0x7) != AM_SEEKING_NoPositioning)
         FIXME("Stop position not handled yet!\n");
 
     args.current = pCurrent;
@@ -5084,6 +5100,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
     fimpl->nItfCacheEntries = 0;
     memcpy(&fimpl->timeformatseek, &TIME_FORMAT_MEDIA_TIME, sizeof(GUID));
     fimpl->start_time = fimpl->position = 0;
+    fimpl->stop_position = -1;
 
     hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
     if (FAILED(hr)) {




More information about the wine-cvs mailing list