From 4a9893d4fca5fb056316d19b8164fd5881e8bc0a Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 30 Jan 2020 19:05:19 -0600 Subject: [PATCH] strmbase: Rename the "pClock" member of struct strmbase_filter to "clock". Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/quartz/dsoundrender.c | 8 +++--- dlls/strmbase/filter.c | 50 ++++++++++++++++++---------------- dlls/strmbase/qualitycontrol.c | 12 ++++---- dlls/strmbase/renderer.c | 8 +++--- include/wine/strmbase.h | 2 +- 5 files changed, 41 insertions(+), 39 deletions(-) diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 4a0f5c4d104..4e991ff5616 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -141,9 +141,9 @@ static HRESULT DSoundRender_GetWritePos(DSoundRenderImpl *This, DWORD *ret_write DSoundRender_UpdatePositions(This, &writepos, &min_writepos); playpos = This->last_playpos; - if (This->renderer.filter.pClock) + if (This->renderer.filter.clock) { - IReferenceClock_GetTime(This->renderer.filter.pClock, &cur); + IReferenceClock_GetTime(This->renderer.filter.clock, &cur); cur -= This->renderer.stream_start; } else write_at = -1; @@ -363,10 +363,10 @@ static HRESULT WINAPI DSoundRender_DoRenderSample(struct strmbase_renderer *ifac TRACE("Sample data ptr = %p, size = %d\n", pbSrcStream, cbSrcStream); hr = DSoundRender_SendSampleData(This, tStart, tStop, pbSrcStream, cbSrcStream); - if (This->renderer.filter.state == State_Running && This->renderer.filter.pClock && tStart >= 0) { + if (This->renderer.filter.state == State_Running && This->renderer.filter.clock && tStart >= 0) { REFERENCE_TIME jitter, now = 0; Quality q; - IReferenceClock_GetTime(This->renderer.filter.pClock, &now); + IReferenceClock_GetTime(This->renderer.filter.clock, &now); jitter = now - This->renderer.stream_start - tStart; if (jitter <= -DSoundRenderer_Max_Fill) jitter += DSoundRenderer_Max_Fill; diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index 84521b80990..98ec3c6f44c 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -380,36 +380,38 @@ static HRESULT WINAPI filter_GetState(IBaseFilter *iface, DWORD timeout, FILTER_ return hr; } -static HRESULT WINAPI filter_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock) +static HRESULT WINAPI filter_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock) { - struct strmbase_filter *This = impl_from_IBaseFilter(iface); - TRACE("(%p)->(%p)\n", This, pClock); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); - EnterCriticalSection(&This->csFilter); - { - if (This->pClock) - IReferenceClock_Release(This->pClock); - This->pClock = pClock; - if (This->pClock) - IReferenceClock_AddRef(This->pClock); - } - LeaveCriticalSection(&This->csFilter); + TRACE("filter %p, clock %p.\n", filter, clock); + + EnterCriticalSection(&filter->csFilter); + + if (filter->clock) + IReferenceClock_Release(filter->clock); + filter->clock = clock; + if (filter->clock) + IReferenceClock_AddRef(filter->clock); + + LeaveCriticalSection(&filter->csFilter); return S_OK; } -static HRESULT WINAPI filter_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock) +static HRESULT WINAPI filter_GetSyncSource(IBaseFilter *iface, IReferenceClock **clock) { - struct strmbase_filter *This = impl_from_IBaseFilter(iface); - TRACE("(%p)->(%p)\n", This, ppClock); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); - EnterCriticalSection(&This->csFilter); - { - *ppClock = This->pClock; - if (This->pClock) - IReferenceClock_AddRef(This->pClock); - } - LeaveCriticalSection(&This->csFilter); + TRACE("filter %p, clock %p.\n", filter, clock); + + EnterCriticalSection(&filter->csFilter); + + *clock = filter->clock; + if (filter->clock) + IReferenceClock_AddRef(filter->clock); + + LeaveCriticalSection(&filter->csFilter); return S_OK; } @@ -528,8 +530,8 @@ void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, void strmbase_filter_cleanup(struct strmbase_filter *This) { - if (This->pClock) - IReferenceClock_Release(This->pClock); + if (This->clock) + IReferenceClock_Release(This->clock); This->IBaseFilter_iface.lpVtbl = NULL; DeleteCriticalSection(&This->csFilter); diff --git a/dlls/strmbase/qualitycontrol.c b/dlls/strmbase/qualitycontrol.c index a7e6e713641..763108d46ac 100644 --- a/dlls/strmbase/qualitycontrol.c +++ b/dlls/strmbase/qualitycontrol.c @@ -160,7 +160,7 @@ void QualityControlRender_DoQOS(QualityControlImpl *priv) TRACE("%p\n", priv); - if (!priv->pin->filter->pClock || priv->current_rstart < 0) + if (!priv->pin->filter->clock || priv->current_rstart < 0) return; start = priv->current_rstart; @@ -276,7 +276,7 @@ void QualityControlRender_BeginRender(QualityControlImpl *This, REFERENCE_TIME s if (start >= 0) { REFERENCE_TIME now; - IReferenceClock_GetTime(This->pin->filter->pClock, &now); + IReferenceClock_GetTime(This->pin->filter->clock, &now); This->current_jitter = (now - This->clockstart) - start; } else @@ -291,10 +291,10 @@ void QualityControlRender_BeginRender(QualityControlImpl *This, REFERENCE_TIME s else This->rendered++; - if (!This->pin->filter->pClock) + if (!This->pin->filter->clock) return; - IReferenceClock_GetTime(This->pin->filter->pClock, &This->start); + IReferenceClock_GetTime(This->pin->filter->clock, &This->start); TRACE("Starting at %s.\n", debugstr_time(This->start)); } @@ -305,8 +305,8 @@ void QualityControlRender_EndRender(QualityControlImpl *This) TRACE("%p\n", This); - if (!This->pin->filter->pClock || This->start < 0 - || FAILED(IReferenceClock_GetTime(This->pin->filter->pClock, &This->stop))) + if (!This->pin->filter->clock || This->start < 0 + || FAILED(IReferenceClock_GetTime(This->pin->filter->clock, &This->stop))) return; elapsed = This->start - This->stop; diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 974823b0466..8470da40f00 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -331,7 +331,7 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa SetEvent(This->state_event); /* Wait for render Time */ - if (This->filter.pClock && SUCCEEDED(IMediaSample_GetTime(pSample, &start, &stop))) + if (This->filter.clock && SUCCEEDED(IMediaSample_GetTime(pSample, &start, &stop))) { hr = S_FALSE; RendererPosPassThru_RegisterMediaTime(This->pPosition, start); @@ -345,20 +345,20 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa REFERENCE_TIME now; DWORD_PTR cookie; - IReferenceClock_GetTime(This->filter.pClock, &now); + IReferenceClock_GetTime(This->filter.clock, &now); if (now - This->stream_start - start <= -10000) { HANDLE handles[2] = {This->advise_event, This->flush_event}; DWORD ret; - IReferenceClock_AdviseTime(This->filter.pClock, This->stream_start, + IReferenceClock_AdviseTime(This->filter.clock, This->stream_start, start, (HEVENT)This->advise_event, &cookie); LeaveCriticalSection(&This->csRenderLock); ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE); - IReferenceClock_Unadvise(This->filter.pClock, cookie); + IReferenceClock_Unadvise(This->filter.clock, cookie); if (ret == 1) { diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index ae0fadb391e..965f6be401a 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -129,7 +129,7 @@ struct strmbase_filter CRITICAL_SECTION csFilter; FILTER_STATE state; - IReferenceClock * pClock; + IReferenceClock *clock; WCHAR name[128]; IFilterGraph *graph; CLSID clsid;