From c3a77c4dc0b13338311b3052f48c35e23d7eb66c Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Wed, 30 Apr 2008 14:27:51 -0700 Subject: [PATCH] quartz: Final filesource fixes After a flush there should be no more samples in a buffer, this code takes care of it --- dlls/quartz/filesource.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 1ac37b0..f410b56 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -1166,7 +1166,8 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw if (buffer >= This->samples) { - FIXME("Returned: %u (%08x)\n", buffer, GetLastError()); + if (buffer != This->samples) + FIXME("Returned: %u (%08x)\n", buffer, GetLastError()); hr = VFW_E_TIMEOUT; buffer = ~0; } @@ -1188,7 +1189,7 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw if (buffer == This->samples) { assert(!This->queued_number); - hr = E_FAIL; + hr = VFW_E_TIMEOUT; } else { @@ -1342,12 +1343,16 @@ static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader * iface) static HRESULT WINAPI FileAsyncReader_EndFlush(IAsyncReader * iface) { FileAsyncReader *This = impl_from_IAsyncReader(iface); + int x; TRACE("()\n"); EnterCriticalSection(&This->csList); ResetEvent(This->handle_list[This->samples]); This->bFlushing = FALSE; + for (x = 0; x < This->samples; ++x) + assert(!This->sample_list[x].pSample); + LeaveCriticalSection(&This->csList); return S_OK; -- 1.5.4.1