Commit 8b0ec725 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Added missing initialization of the filesource output pin critical

section. Avoid indefinite wait when calling GetOverlappedResult. Fixed initial refcount of the IMemAllocator object. Improved some traces.
parent 869e9caf
......@@ -882,6 +882,7 @@ static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter
pPinImpl->hEvent = CreateEventW(NULL, 0, 0, NULL);
pPinImpl->bFlushing = FALSE;
pPinImpl->pHead = NULL;
InitializeCriticalSection(&pPinImpl->csList);
*ppPin = (IPin *)(&pPinImpl->pin.pin.lpVtbl);
return S_OK;
......@@ -1092,7 +1093,7 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw
{
DWORD dwBytes;
/* get any errors */
if (!GetOverlappedResult(This->hFile, &pDataRq->ovl, &dwBytes, TRUE))
if (!GetOverlappedResult(This->hFile, &pDataRq->ovl, &dwBytes, FALSE))
hr = HRESULT_FROM_WIN32(GetLastError());
}
......
......@@ -97,7 +97,7 @@ static HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), HRESU
pMemAlloc->lpVtbl = &BaseMemAllocator_VTable;
pMemAlloc->ref = 0;
pMemAlloc->ref = 1;
pMemAlloc->pProps = NULL;
list_init(&pMemAlloc->free_list);
list_init(&pMemAlloc->used_list);
......@@ -474,7 +474,7 @@ static ULONG WINAPI StdMediaSample2_AddRef(IMediaSample2 * iface)
{
ICOM_THIS(StdMediaSample2, iface);
TRACE("()\n");
TRACE("(%p)->() AddRef from %ld\n", iface, This->ref);
return InterlockedIncrement(&This->ref);
}
......@@ -483,7 +483,7 @@ static ULONG WINAPI StdMediaSample2_Release(IMediaSample2 * iface)
{
ICOM_THIS(StdMediaSample2, iface);
TRACE("()\n");
TRACE("(%p)->() Release from %ld\n", iface, This->ref);
if (!InterlockedDecrement(&This->ref))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment