strmbase: Rename the "pClock" member of struct strmbase_filter to "clock".
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6f71e2c48d
commit
4a9893d4fc
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -129,7 +129,7 @@ struct strmbase_filter
|
|||
CRITICAL_SECTION csFilter;
|
||||
|
||||
FILTER_STATE state;
|
||||
IReferenceClock * pClock;
|
||||
IReferenceClock *clock;
|
||||
WCHAR name[128];
|
||||
IFilterGraph *graph;
|
||||
CLSID clsid;
|
||||
|
|
Loading…
Reference in New Issue