[PATCH 4/4] quartz: Fix error handling in PullPin_Thread_Process().

Eduard - Gabriel Munteanu eduard.munteanu at linux360.ro
Thu Aug 27 14:13:55 CDT 2009


This fixes a FIXME by providing proper error handling for
IAsyncReader_WaitForNext() calls. It also handles empty samples returned
in case the pin is flushing, which previously resulted in Wine crashing
in Fallout 3 due to a failed assertion (we expected the sample to be
NULL).

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu at linux360.ro>
---
 dlls/quartz/pin.c |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c
index 11f20c7..f48d5ef 100644
--- a/dlls/quartz/pin.c
+++ b/dlls/quartz/pin.c
@@ -1333,13 +1333,26 @@ 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)
+            switch (hr)
             {
-                assert(!pSample);
+            case VFW_E_TIMEOUT:
+            case VFW_E_WRONG_STATE:
+                /*
+                 * In case the pin is flushing, we might
+                 * get an empty sample, which we'll discard later.
+                 */
                 hr = S_OK;
-                continue;
+                /* We can't really distinguish between timeout or flushing. */
+                WARN("Timeout or pin is flushing");
+                break;
+            case E_FAIL:
+                ERR("Read error!\n");
+                pSample = NULL;
+                break;
+            default:
+                ERR("Unknown error: %x\n", hr);
+                pSample = NULL;
+                break;
             }
         }
 
-- 
1.6.0.6




More information about the wine-patches mailing list