Zebediah Figura : quartz/filtergraph: Correctly handle AM_SEEKING_ReturnTime in IMediaSeeking::SetPositions().

Alexandre Julliard julliard at winehq.org
Mon Oct 21 15:28:37 CDT 2019


Module: wine
Branch: master
Commit: 0705b0f1826dfddabbb00ba61f35f9589306a4b0
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0705b0f1826dfddabbb00ba61f35f9589306a4b0

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sat Oct 19 10:48:25 2019 -0500

quartz/filtergraph: Correctly handle AM_SEEKING_ReturnTime in IMediaSeeking::SetPositions().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/filtergraph.c       | 12 +++++++++++-
 dlls/quartz/tests/filtergraph.c | 18 +++++++++---------
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 15517fee57..96c9ae31f0 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -2560,8 +2560,18 @@ struct pos_args {
 static HRESULT WINAPI found_setposition(IFilterGraphImpl *This, IMediaSeeking *seek, DWORD_PTR pargs)
 {
     struct pos_args *args = (void*)pargs;
+    LONGLONG current = args->current ? *args->current : 0, stop = args->stop ? *args->stop : 0;
+    HRESULT hr;
 
-    return IMediaSeeking_SetPositions(seek, args->current, args->curflags, args->stop, args->stopflags);
+    if (SUCCEEDED(hr = IMediaSeeking_SetPositions(seek, &current,
+            args->curflags, &stop, args->stopflags)))
+    {
+        if (args->current && (args->curflags & AM_SEEKING_ReturnTime))
+            *args->current = current;
+        if (args->stop && (args->stopflags & AM_SEEKING_ReturnTime))
+            *args->stop = stop;
+    }
+    return hr;
 }
 
 static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG *pCurrent,
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index 5dc32eb36a..a768b737fb 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -3808,10 +3808,10 @@ static void test_graph_seeking(void)
     hr = IMediaSeeking_SetPositions(seeking, &current, AM_SEEKING_AbsolutePositioning,
             &stop, AM_SEEKING_AbsolutePositioning);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
-    todo_wine ok(current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(current));
-    todo_wine ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
-    todo_wine ok(filter1.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
-    todo_wine ok(filter1.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
+    ok(current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(current));
+    ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
+    ok(filter1.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
+    ok(filter1.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
     ok(filter2.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_current));
     ok(filter2.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_stop));
 
@@ -3844,7 +3844,7 @@ static void test_graph_seeking(void)
     hr = IMediaSeeking_GetPositions(seeking, &current, &stop);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
     todo_wine ok(current == 12340000, "Got time %s.\n", wine_dbgstr_longlong(current));
-    todo_wine ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
+    ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
 
     current = 0x123;
     stop = 0x321;
@@ -3852,9 +3852,9 @@ static void test_graph_seeking(void)
             &stop, AM_SEEKING_AbsolutePositioning);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
     ok(current == 12340000, "Got time %s.\n", wine_dbgstr_longlong(current));
-    todo_wine ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
+    ok(stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(stop));
     ok(filter1.seek_current == 12340000, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
-    todo_wine ok(filter1.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
+    ok(filter1.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
     ok(filter2.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_current));
     ok(filter2.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_stop));
 
@@ -3863,9 +3863,9 @@ static void test_graph_seeking(void)
     hr = IMediaSeeking_SetPositions(seeking, &current, AM_SEEKING_AbsolutePositioning,
             &stop, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
-    todo_wine ok(current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(current));
+    ok(current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(current));
     ok(stop == 43210000, "Got time %s.\n", wine_dbgstr_longlong(stop));
-    todo_wine ok(filter1.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
+    ok(filter1.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_current));
     ok(filter1.seek_stop == 43210000, "Got time %s.\n", wine_dbgstr_longlong(filter1.seek_stop));
     ok(filter2.seek_current == 0x123, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_current));
     ok(filter2.seek_stop == 0x321, "Got time %s.\n", wine_dbgstr_longlong(filter2.seek_stop));




More information about the wine-cvs mailing list