From b1f9acc68862d28a934f5fa5a6e2ec2635af9df6 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Fri, 14 Mar 2008 11:02:01 -0700 Subject: [PATCH] quartz: Set a default sync source on the filtergraph. Use the fallback system IReferenceClock, unless the app comes up with its own clock. --- dlls/quartz/filtergraph.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 762e3e2ccaa..f0564213a26 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -620,10 +620,20 @@ static HRESULT WINAPI FilterGraph2_Disconnect(IFilterGraph2 *iface, static HRESULT WINAPI FilterGraph2_SetDefaultSyncSource(IFilterGraph2 *iface) { ICOM_THIS_MULTI(IFilterGraphImpl, IFilterGraph2_vtbl, iface); + IReferenceClock *pClock = NULL; + HRESULT hr; - TRACE("(%p/%p)->(): stub !!!\n", iface, This); + TRACE("(%p/%p)->() semi-stub\n", iface, This); - return S_OK; + hr = CoCreateInstance(&CLSID_SystemClock, NULL, CLSCTX_INPROC_SERVER, &IID_IReferenceClock, (LPVOID*)&pClock); + + if (SUCCEEDED(hr)) + { + hr = IMediaFilter_SetSyncSource((IMediaFilter*)&(This->IMediaFilter_vtbl), pClock); + IReferenceClock_Release(pClock); + } + + return hr; } static HRESULT GetFilterInfo(IMoniker* pMoniker, GUID* pclsid, VARIANT* pvar) @@ -4755,6 +4765,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj) ERR("Unable to create filter mapper (%x)\n", hr); return hr; } + IFilterGraph2_SetDefaultSyncSource((IFilterGraph2*)fimpl); *ppObj = fimpl; return S_OK;