Erich Hoover ehoover@mines.edu writes:
@@ -479,13 +488,27 @@ static void PullPin_Thread_Process(PullPin *This) else { /* FIXME: This is not well handled yet! */
ERR("Processing error: %x\n", hr); if (hr == VFW_E_TIMEOUT) {
assert(!pSample);
struct timeval tve;
/*
* Calculate the time elapsed in IAsyncReader::WaitForNext
* in order to determine whether a timeout actually occurred
* or whether the pin is flushing.
*/
timersub(&tv2, &tv1, &tve);
if (!timercmp(&tve, &tvw, <) && pSample != NULL)
{
ERR("Non-NULL sample returned with VFW_E_TIMEOUT.\n");
break;
}
That's really ugly. Surely there's a better way to do this than measuring the elapsed time.