LONG cbActual;
hr = m_pIo->SyncReadAligned(llPos,
lLength,
pBuffer,
&cbActual,
pSample);
pSample->SetActualDataLength(cbActual);
return hr;
}
//
// collect the next ready sample
STDMETHODIMP
CAsyncOutputPin::WaitForNext(
DWORD dwTimeout,
IMediaSample** ppSample, // completed sample
DWORD * pdwUser) // user context
{
CheckPointer(ppSample,E_POINTER);
LONG cbActual;
IMediaSample* pSample=0;
HRESULT hr = m_pIo->WaitForNext(dwTimeout,
(LPVOID*) &pSample,
pdwUser,
&cbActual);
if(SUCCEEDED(hr))
{
pSample->SetActualDataLength(cbActual);
}
*ppSample = pSample;
return hr;
}
//
// synchronous read that need not be aligned.
STDMETHODIMP
CAsyncOutputPin::SyncRead(
LONGLONG llPosition, // absolute Io position
LONG lLength, // nr bytes required
BYTE* pBuffer) // write data here
{
return m_pIo->SyncRead(llPosition, lLength, pBuffer);
}
// return the length of the file, and the length currently
// available locally. We only support locally accessible files,
// so they are always the same
STDMETHODIMP
CAsyncOutputPin::Length(
LONGLONG* pTotal,
LONGLONG* pAvailable)
{
return m_pIo->Length(pTotal, pAvailable);
}
STDMETHODIMP
CAsyncOutputPin::BeginFlush(void)
{
return m_pIo->BeginFlush();
}
STDMETHODIMP
CAsyncOutputPin::EndFlush(