quartz: Remove default clock if the providing filter is removed from filtergraph.

This commit is contained in:
Maarten Lankhorst 2010-12-06 14:16:41 +01:00 committed by Alexandre Julliard
parent c12d9ff8d7
commit 804a9d14c9
1 changed files with 13 additions and 0 deletions

View File

@ -184,6 +184,7 @@ typedef struct _IFilterGraphImpl {
int filterCapacity; int filterCapacity;
LONG nameIndex; LONG nameIndex;
IReferenceClock *refClock; IReferenceClock *refClock;
IBaseFilter *refClockProvider;
EventsQueue evqueue; EventsQueue evqueue;
HANDLE hEventCompletion; HANDLE hEventCompletion;
int CompletionStatus; int CompletionStatus;
@ -484,6 +485,12 @@ static HRESULT WINAPI FilterGraph2_RemoveFilter(IFilterGraph2 *iface, IBaseFilte
IEnumPins *penumpins = NULL; IEnumPins *penumpins = NULL;
FILTER_STATE state; FILTER_STATE state;
if (This->defaultclock && This->refClockProvider == pFilter)
{
IMediaFilter_SetSyncSource((IMediaFilter*)&This->IMediaFilter_vtbl, NULL);
This->defaultclock = 1;
}
TRACE("Removing filter %s\n", debugstr_w(This->pFilterNames[i])); TRACE("Removing filter %s\n", debugstr_w(This->pFilterNames[i]));
IBaseFilter_GetState(pFilter, 0, &state); IBaseFilter_GetState(pFilter, 0, &state);
if (state == State_Running) if (state == State_Running)
@ -781,7 +788,12 @@ static HRESULT WINAPI FilterGraph2_SetDefaultSyncSource(IFilterGraph2 *iface) {
} }
if (!pClock) if (!pClock)
{
hr = CoCreateInstance(&CLSID_SystemClock, NULL, CLSCTX_INPROC_SERVER, &IID_IReferenceClock, (LPVOID*)&pClock); hr = CoCreateInstance(&CLSID_SystemClock, NULL, CLSCTX_INPROC_SERVER, &IID_IReferenceClock, (LPVOID*)&pClock);
This->refClockProvider = NULL;
}
else
This->refClockProvider = This->ppFiltersInGraph[i];
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
@ -5485,6 +5497,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
fimpl->notif.disabled = FALSE; fimpl->notif.disabled = FALSE;
fimpl->nRenderers = 0; fimpl->nRenderers = 0;
fimpl->EcCompleteCount = 0; fimpl->EcCompleteCount = 0;
fimpl->refClockProvider = NULL;
fimpl->state = State_Stopped; fimpl->state = State_Stopped;
EventsQueue_Init(&fimpl->evqueue); EventsQueue_Init(&fimpl->evqueue);
InitializeCriticalSection(&fimpl->cs); InitializeCriticalSection(&fimpl->cs);