Maarten Lankhorst : quartz: Do timekeeping in the avi decoder.

Alexandre Julliard julliard at winehq.org
Thu May 22 06:27:32 CDT 2008


Module: wine
Branch: master
Commit: c4e32aad01372f5624dce37c1d4699f6095d31af
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c4e32aad01372f5624dce37c1d4699f6095d31af

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Wed May 21 14:33:47 2008 -0700

quartz: Do timekeeping in the avi decoder.

Fixes the timestamps generated.

---

 dlls/quartz/avidec.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c
index d449662..3f0aed7 100644
--- a/dlls/quartz/avidec.c
+++ b/dlls/quartz/avidec.c
@@ -78,12 +78,13 @@ static HRESULT AVIDec_ProcessSampleData(TransformFilterImpl* pTransformFilter, I
     LPBYTE pbDstStream;
     DWORD cbSrcStream;
     LPBYTE pbSrcStream;
+    LONGLONG tStart, tStop;
 
     hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
     if (FAILED(hr))
     {
         ERR("Cannot get pointer to sample data (%x)\n", hr);
-	return hr;
+        return hr;
     }
 
     cbSrcStream = IMediaSample_GetActualDataLength(pSample);
@@ -92,8 +93,8 @@ static HRESULT AVIDec_ProcessSampleData(TransformFilterImpl* pTransformFilter, I
 
     hr = IPin_ConnectionMediaType(This->tf.ppPins[0], &amt);
     if (FAILED(hr)) {
-	ERR("Unable to retrieve media type\n");
-	goto error;
+        ERR("Unable to retrieve media type\n");
+        goto error;
     }
 
     /* Update input size to match sample size */
@@ -124,6 +125,16 @@ static HRESULT AVIDec_ProcessSampleData(TransformFilterImpl* pTransformFilter, I
     if (res != ICERR_OK)
         ERR("Error occurred during the decompression (%x)\n", res);
 
+
+    IMediaSample_SetPreroll(pOutSample, (IMediaSample_IsPreroll(pSample) == S_OK));
+    IMediaSample_SetDiscontinuity(pOutSample, (IMediaSample_IsDiscontinuity(pSample) == S_OK));
+    IMediaSample_SetSyncPoint(pOutSample, (IMediaSample_IsSyncPoint(pSample) == S_OK));
+
+    if (IMediaSample_GetTime(pSample, &tStart, &tStop) == S_OK)
+        IMediaSample_SetTime(pOutSample, &tStart, &tStop);
+    else
+        IMediaSample_SetTime(pOutSample, NULL, NULL);
+
     hr = OutputPin_SendSample((OutputPin*)This->tf.ppPins[1], pOutSample);
     if (hr != S_OK && hr != VFW_E_NOT_CONNECTED) {
         ERR("Error sending sample (%x)\n", hr);




More information about the wine-cvs mailing list