[PATCH v3 3/6] quartz: Do not send events when notifications are disabled.

Anton Baskanov baskanov at gmail.com
Wed Feb 17 00:09:03 CST 2021


Signed-off-by: Anton Baskanov <baskanov at gmail.com>
---
 dlls/quartz/filtergraph.c       | 29 ++++++++++++++++++-----------
 dlls/quartz/tests/filtergraph.c |  6 +++---
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 58038829217..8c1cd6232e4 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -5288,15 +5288,22 @@ static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, LONG EventCo
         TRACE("Process EC_COMPLETE notification\n");
         if (++This->EcCompleteCount == This->nRenderers)
         {
-            evt.lEventCode = EC_COMPLETE;
-            evt.lParam1 = S_OK;
-            evt.lParam2 = 0;
-            TRACE("Send EC_COMPLETE to app\n");
-            EventsQueue_PutEvent(&This->evqueue, &evt);
-            if (!This->notif.disabled && This->notif.hWnd)
-	    {
-                TRACE("Send Window message\n");
-                PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
+            if (!This->notif.disabled)
+            {
+                evt.lEventCode = EC_COMPLETE;
+                evt.lParam1 = S_OK;
+                evt.lParam2 = 0;
+                TRACE("Send EC_COMPLETE to app\n");
+                EventsQueue_PutEvent(&This->evqueue, &evt);
+                if (This->notif.hWnd)
+                {
+                    TRACE("Send Window message\n");
+                    PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
+                }
+            }
+            else
+            {
+                SetEvent(This->evqueue.msg_event);
             }
             This->CompletionStatus = EC_COMPLETE;
             This->got_ec_complete = 1;
@@ -5307,13 +5314,13 @@ static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, LONG EventCo
     {
         /* FIXME: Not handled yet */
     }
-    else
+    else if (!This->notif.disabled)
     {
         evt.lEventCode = EventCode;
         evt.lParam1 = EventParam1;
         evt.lParam2 = EventParam2;
         EventsQueue_PutEvent(&This->evqueue, &evt);
-        if (!This->notif.disabled && This->notif.hWnd)
+        if (This->notif.hWnd)
             PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
     }
 
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index 7d4cfce2628..55c70702e47 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -5207,12 +5207,12 @@ static void test_set_notify_flags(void)
     hr = IMediaEventSink_Notify(media_event_sink, EC_STATUS, (LONG_PTR)status, (LONG_PTR)status);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
 
-    todo_wine ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n");
+    ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n");
 
     ok(!PeekMessageA(&msg, window, WM_USER, WM_USER, PM_REMOVE), "Window should not be notified.\n");
 
     hr = IMediaEventEx_GetEvent(media_event, &code, &param1, &param2, 50);
-    todo_wine ok(hr == E_ABORT, "Got hr %#x.\n", hr);
+    ok(hr == E_ABORT, "Got hr %#x.\n", hr);
 
     hr = IMediaEventSink_Notify(media_event_sink, EC_COMPLETE, S_OK,
             (LONG_PTR)&filter.IBaseFilter_iface);
@@ -5242,7 +5242,7 @@ static void test_set_notify_flags(void)
     ok(WaitForSingleObject(event, 0) == 0, "Event should be signaled.\n");
 
     hr = IMediaEventEx_GetEvent(media_event, &code, &param1, &param2, 50);
-    todo_wine ok(hr == E_ABORT, "Got hr %#x.\n", hr);
+    ok(hr == E_ABORT, "Got hr %#x.\n", hr);
 
     todo_wine ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n");
 
-- 
2.25.1




More information about the wine-devel mailing list