Module: wine Branch: master Commit: 0458c08b95d368cba6daf1f216c0e930c6387dd6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0458c08b95d368cba6daf1f216...
Author: Maarten Lankhorst m.b.lankhorst@gmail.com Date: Fri Apr 18 16:07:40 2008 -0700
quartz: Set media time in the file source.
---
dlls/quartz/filesource.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 8704b50..930ebfc 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -1127,6 +1127,9 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw
if (SUCCEEDED(hr)) { + REFERENCE_TIME rtStart, rtStop; + REFERENCE_TIME rtSampleStart, rtSampleStop; + /* get any errors */ if (!This->bFlushing && !GetOverlappedResult(This->hFile, &pDataRq->ovl, &dwBytes, FALSE)) hr = HRESULT_FROM_WIN32(GetLastError()); @@ -1141,7 +1144,18 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw dwBytes = 0; }
+ /* Set the time on the sample */ IMediaSample_SetActualDataLength(pDataRq->pSample, dwBytes); + + rtStart = (DWORD64)pDataRq->ovl.u.s.Offset + ((DWORD64)pDataRq->ovl.u.s.OffsetHigh << 32); + rtStart = MEDIATIME_FROM_BYTES(rtStart); + rtStop = rtStart + MEDIATIME_FROM_BYTES(dwBytes); + + IMediaSample_GetTime(pDataRq->pSample, &rtSampleStart, &rtSampleStop); + assert(rtStart == rtSampleStart); + assert(rtStop <= rtSampleStop); + + IMediaSample_SetTime(pDataRq->pSample, &rtStart, &rtStop); }
/* no need to close event handle since we will close it when the pin is destroyed */