Commit c4cdfdac authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

quartz: More filesource fixes.

After a flush call there should be no more samples in the buffer.
parent 4afc2ae9
...@@ -1166,7 +1166,8 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw ...@@ -1166,7 +1166,8 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw
if (buffer >= This->samples) 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; hr = VFW_E_TIMEOUT;
buffer = ~0; buffer = ~0;
} }
...@@ -1188,7 +1189,7 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw ...@@ -1188,7 +1189,7 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw
if (buffer == This->samples) if (buffer == This->samples)
{ {
assert(!This->queued_number); assert(!This->queued_number);
hr = E_FAIL; hr = VFW_E_TIMEOUT;
} }
else else
{ {
...@@ -1342,12 +1343,16 @@ static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader * iface) ...@@ -1342,12 +1343,16 @@ static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader * iface)
static HRESULT WINAPI FileAsyncReader_EndFlush(IAsyncReader * iface) static HRESULT WINAPI FileAsyncReader_EndFlush(IAsyncReader * iface)
{ {
FileAsyncReader *This = impl_from_IAsyncReader(iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
int x;
TRACE("()\n"); TRACE("()\n");
EnterCriticalSection(&This->csList); EnterCriticalSection(&This->csList);
ResetEvent(This->handle_list[This->samples]); ResetEvent(This->handle_list[This->samples]);
This->bFlushing = FALSE; This->bFlushing = FALSE;
for (x = 0; x < This->samples; ++x)
assert(!This->sample_list[x].pSample);
LeaveCriticalSection(&This->csList); LeaveCriticalSection(&This->csList);
return S_OK; return S_OK;
......
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