quartz: Make acmwrapper respect preroll samples.

This commit is contained in:
Maarten Lankhorst 2008-04-18 16:07:05 -07:00 committed by Alexandre Julliard
parent d16639d1fa
commit 172347341a

View File

@ -58,7 +58,7 @@ static HRESULT ACMWrapper_ProcessSampleData(TransformFilterImpl* pTransformFilte
LPBYTE pbDstStream; LPBYTE pbDstStream;
LPBYTE pbSrcStream = NULL; LPBYTE pbSrcStream = NULL;
ACMSTREAMHEADER ash; ACMSTREAMHEADER ash;
BOOL unprepare_header = FALSE; BOOL unprepare_header = FALSE, preroll;
MMRESULT res; MMRESULT res;
HRESULT hr; HRESULT hr;
LONGLONG tStart = -1, tStop = -1, tMed; LONGLONG tStart = -1, tStop = -1, tMed;
@ -70,6 +70,8 @@ static HRESULT ACMWrapper_ProcessSampleData(TransformFilterImpl* pTransformFilte
return hr; return hr;
} }
preroll = (IMediaSample_IsPreroll(pSample) == S_OK);
IMediaSample_GetTime(pSample, &tStart, &tStop); IMediaSample_GetTime(pSample, &tStart, &tStop);
cbSrcStream = IMediaSample_GetActualDataLength(pSample); cbSrcStream = IMediaSample_GetActualDataLength(pSample);
@ -91,6 +93,7 @@ static HRESULT ACMWrapper_ProcessSampleData(TransformFilterImpl* pTransformFilte
ERR("Unable to get delivery buffer (%x)\n", hr); ERR("Unable to get delivery buffer (%x)\n", hr);
return hr; return hr;
} }
IMediaSample_SetPreroll(pOutSample, preroll);
hr = IMediaSample_SetActualDataLength(pOutSample, 0); hr = IMediaSample_SetActualDataLength(pOutSample, 0);
assert(hr == S_OK); assert(hr == S_OK);