quartz: Send a notification when the filter graph clock changes

Chris Robinson chris.kcat at gmail.com
Fri Apr 6 00:21:32 CDT 2007


-------------- next part --------------
From 4e810d905343d5919f20970402aac437b6c814ca Mon Sep 17 00:00:00 2001
From: Chris Robinson <chris.kcat at gmail.com>
Date: Thu, 5 Apr 2007 13:19:30 -0700
Subject: [PATCH] quartz: Send a notification when the filter graph clock changes

---
 dlls/quartz/filtergraph.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 51ea94a..e6c19f5 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -190,6 +190,7 @@ typedef struct _IFilterGraphImpl {
     int EcCompleteCount;
     int HandleEcComplete;
     int HandleEcRepaint;
+    int HandleEcClockChanged;
     OAFilterState state;
     CRITICAL_SECTION cs;
     ITF_CACHE_ENTRY ItfCacheEntries[MAX_ITF_CACHE_ENTRIES];
@@ -4109,6 +4110,8 @@ static HRESULT WINAPI MediaEvent_CancelDefaultHandling(IMediaEventEx *iface,
 	This->HandleEcComplete = FALSE;
     else if (lEvCode == EC_REPAINT)
 	This->HandleEcRepaint = FALSE;
+    else if (lEvCode == EC_CLOCK_CHANGED)
+        This->HandleEcClockChanged = FALSE;
     else
 	return S_FALSE;
 
@@ -4125,6 +4128,8 @@ static HRESULT WINAPI MediaEvent_RestoreDefaultHandling(IMediaEventEx *iface,
 	This->HandleEcComplete = TRUE;
     else if (lEvCode == EC_REPAINT)
 	This->HandleEcRepaint = TRUE;
+    else if (lEvCode == EC_CLOCK_CHANGED)
+        This->HandleEcClockChanged = TRUE;
     else
 	return S_FALSE;
 
@@ -4293,6 +4298,19 @@ static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceC
             This->refClock = pClock;
             if (This->refClock)
                 IReferenceClock_AddRef(This->refClock);
+
+            if (This->HandleEcClockChanged)
+            {
+                IMediaEventSink *pEventSink;
+                HRESULT eshr;
+
+                eshr = IMediaFilter_QueryInterface(iface, &IID_IMediaEventSink, (LPVOID)&pEventSink);
+                if (SUCCEEDED(eshr))
+                {
+                    IMediaEventSink_Notify(pEventSink, EC_CLOCK_CHANGED, 0, 0);
+                    IMediaEventSink_Release(pEventSink);
+                }
+            }
         }
     }
     LeaveCriticalSection(&This->cs);
@@ -4594,6 +4612,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
     fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE, 0);
     fimpl->HandleEcComplete = TRUE;
     fimpl->HandleEcRepaint = TRUE;
+    fimpl->HandleEcClockChanged = TRUE;
     fimpl->notif.hWnd = 0;
     fimpl->notif.disabled = FALSE;
     fimpl->nRenderers = 0;
-- 
1.4.4.4



More information about the wine-patches mailing list