Maarten Lankhorst : quartz: Add some sanity checks to file splitter.
Alexandre Julliard
julliard at winehq.org
Wed Apr 23 07:59:40 CDT 2008
Module: wine
Branch: master
Commit: ec124be8239b6292ba239bb24f125cd4e267fdd5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ec124be8239b6292ba239bb24f125cd4e267fdd5
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Tue Apr 22 13:44:33 2008 -0700
quartz: Add some sanity checks to file splitter.
---
dlls/quartz/filesource.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index 930ebfc..396384f 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -1107,6 +1107,9 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw
if (!This->bFlushing)
{
+ if (!This->pHead)
+ ERR("Called without samples in queue!\n");
+
/* wait for the read to finish or timeout */
if (WaitForSingleObject(This->hEvent, dwTimeout) == WAIT_TIMEOUT)
hr = VFW_E_TIMEOUT;
@@ -1139,10 +1142,10 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw
*pdwUser = pDataRq->dwUserData;
if (This->bFlushing)
- {
hr = VFW_E_WRONG_STATE;
+
+ if (FAILED(hr))
dwBytes = 0;
- }
/* Set the time on the sample */
IMediaSample_SetActualDataLength(pDataRq->pSample, dwBytes);
@@ -1156,6 +1159,12 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw
assert(rtStop <= rtSampleStop);
IMediaSample_SetTime(pDataRq->pSample, &rtStart, &rtStop);
+ assert(rtStart == rtSampleStart);
+ if (hr == S_OK)
+ assert(rtStop == rtSampleStop);
+ else
+ assert(rtStop == rtStart);
+
}
/* no need to close event handle since we will close it when the pin is destroyed */
More information about the wine-cvs
mailing list