Module: wine Branch: master Commit: f5400a28519a0d64e6f97464ec4596d1c8555b86 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f5400a28519a0d64e6f97464ec...
Author: Chris Robinson chris.kcat@gmail.com Date: Sun Mar 25 15:18:49 2007 -0700
quartz: Store the current reference time with the PullPin.
---
dlls/quartz/pin.c | 13 +++++++------ dlls/quartz/pin.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c index b3aa042..58e5bee 100644 --- a/dlls/quartz/pin.c +++ b/dlls/quartz/pin.c @@ -1044,6 +1044,7 @@ HRESULT PullPin_Init(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPVOID p pPinImpl->hEventStateChanged = CreateEventW(NULL, FALSE, TRUE, NULL);
pPinImpl->rtStart = 0; + pPinImpl->rtCurrent = 0; pPinImpl->rtStop = ((LONGLONG)0x7fffffff << 32) | 0xffffffff;
return S_OK; @@ -1177,7 +1178,6 @@ static void CALLBACK PullPin_Thread_Process(ULONG_PTR iface) PullPin *This = (PullPin *)iface; HRESULT hr;
- REFERENCE_TIME rtCurrent; ALLOCATOR_PROPERTIES allocProps; PIN_INFO pinInfo;
@@ -1187,11 +1187,12 @@ static void CALLBACK PullPin_Thread_Process(ULONG_PTR iface)
hr = IMemAllocator_GetProperties(This->pAlloc, &allocProps);
- rtCurrent = MEDIATIME_FROM_BYTES(ALIGNDOWN(BYTES_FROM_MEDIATIME(This->rtStart), allocProps.cbAlign)); + if (This->rtCurrent < This->rtStart) + This->rtCurrent = MEDIATIME_FROM_BYTES(ALIGNDOWN(BYTES_FROM_MEDIATIME(This->rtStart), allocProps.cbAlign));
TRACE("Start\n");
- while (rtCurrent < This->rtStop && hr == S_OK) + while (This->rtCurrent < This->rtStop && hr == S_OK) { /* FIXME: to improve performance by quite a bit this should be changed * so that one sample is processed while one sample is fetched. However, @@ -1208,11 +1209,11 @@ static void CALLBACK PullPin_Thread_Process(ULONG_PTR iface)
if (SUCCEEDED(hr)) { - rtSampleStop = rtCurrent + MEDIATIME_FROM_BYTES(IMediaSample_GetSize(pSample)); + rtSampleStop = This->rtCurrent + MEDIATIME_FROM_BYTES(IMediaSample_GetSize(pSample)); if (rtSampleStop > This->rtStop) rtSampleStop = MEDIATIME_FROM_BYTES(ALIGNUP(BYTES_FROM_MEDIATIME(This->rtStop), allocProps.cbAlign)); - hr = IMediaSample_SetTime(pSample, &rtCurrent, &rtSampleStop); - rtCurrent = rtSampleStop; + hr = IMediaSample_SetTime(pSample, &This->rtCurrent, &rtSampleStop); + This->rtCurrent = rtSampleStop; }
if (SUCCEEDED(hr)) diff --git a/dlls/quartz/pin.h b/dlls/quartz/pin.h index bb48df3..02830cc 100644 --- a/dlls/quartz/pin.h +++ b/dlls/quartz/pin.h @@ -84,6 +84,7 @@ typedef struct PullPin HANDLE hEventStateChanged; REFERENCE_TIME rtStart; REFERENCE_TIME rtStop; + REFERENCE_TIME rtCurrent; } PullPin;
/*** Initializers ***/