[PATCH 4/5] quartz/filtergraph: Pause the graph even if AM_SEEKING_NoFlush is used.

Zebediah Figura z.figura12 at gmail.com
Mon Oct 21 16:54:50 CDT 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/quartz/filtergraph.c       |  4 ++--
 dlls/quartz/tests/filtergraph.c | 12 ++++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 182ea5a2be..9750e6fe84 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -2583,7 +2583,7 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG *
     EnterCriticalSection(&graph->cs);
 
     state = graph->state;
-    if (state == State_Running && !(current_flags & AM_SEEKING_NoFlush))
+    if (state == State_Running)
         IMediaControl_Pause(&graph->IMediaControl_iface);
 
     LIST_FOR_EACH_ENTRY(filter, &graph->filters, struct filter, entry)
@@ -2616,7 +2616,7 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG *
     if ((current_flags & 0x7) != AM_SEEKING_NoPositioning)
         graph->pause_time = graph->start_time = -1;
 
-    if (state == State_Running && !(current_flags & AM_SEEKING_NoFlush))
+    if (state == State_Running)
         IMediaControl_Run(&graph->IMediaControl_iface);
 
     LeaveCriticalSection(&graph->cs);
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index 4b9b3b675c..3ef610d76b 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -3917,6 +3917,14 @@ static void test_graph_seeking(void)
             "Expected about 1234ms, got %s.\n", wine_dbgstr_longlong(current));
     ok(stop == 9000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
 
+    /* This remains true even if NoFlush is specified. */
+    current = 1000 * 10000;
+    stop = 8000 * 10000;
+    hr = IMediaSeeking_SetPositions(seeking, &current,
+            AM_SEEKING_AbsolutePositioning | AM_SEEKING_NoFlush,
+            &stop, AM_SEEKING_AbsolutePositioning | AM_SEEKING_NoFlush);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+
     Sleep(100);
 
     hr = IMediaSeeking_GetCurrentPosition(seeking, &time);
@@ -3928,7 +3936,7 @@ static void test_graph_seeking(void)
     ok(hr == S_OK, "Got hr %#x.\n", hr);
     ok(abs(current - 1334 * 10000) < 40 * 10000,
             "Expected about 1334ms, got %s.\n", wine_dbgstr_longlong(current));
-    ok(stop == 9000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
+    ok(stop == 8000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
 
     hr = IMediaControl_Pause(control);
     todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -3946,7 +3954,7 @@ static void test_graph_seeking(void)
     ok(hr == S_OK, "Got hr %#x.\n", hr);
     todo_wine ok(abs(current - 1334 * 10000) < 40 * 10000,
             "Expected about 1334ms, got %s.\n", wine_dbgstr_longlong(current));
-    ok(stop == 9000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
+    ok(stop == 8000 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
 
     hr = IMediaControl_Stop(control);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
-- 
2.20.1




More information about the wine-devel mailing list