Tim Clem : quartz: Remove the source filter on failure in IGraphBuilder::RenderFile().

Alexandre Julliard julliard at winehq.org
Tue Jun 29 15:58:27 CDT 2021


Module: wine
Branch: master
Commit: 83ae1ff59a4695ed1a7ee8e139aab267176e0747
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=83ae1ff59a4695ed1a7ee8e139aab267176e0747

Author: Tim Clem <tclem at codeweavers.com>
Date:   Tue Jun 29 14:59:58 2021 -0500

quartz: Remove the source filter on failure in IGraphBuilder::RenderFile().

Signed-off-by: Tim Clem <tclem at codeweavers.com>
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/filtergraph.c       | 8 ++++++++
 dlls/quartz/tests/filtergraph.c | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index f509bdad332..4861d6cf1b0 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -1431,11 +1431,19 @@ static HRESULT WINAPI FilterGraph2_RenderFile(IFilterGraph2 *iface, LPCWSTR lpcw
         IEnumPins_Release(penumpins);
 
         if (!any)
+        {
+            if (FAILED(hr = IFilterGraph2_RemoveFilter(iface, preader)))
+                ERR("Failed to remove source filter, hr %#x.\n", hr);
             hr = VFW_E_CANNOT_RENDER;
+        }
         else if (partial)
+        {
             hr = VFW_S_PARTIAL_RENDER;
+        }
         else
+        {
             hr = S_OK;
+        }
     }
     IBaseFilter_Release(preader);
 
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index 557b3965016..fef7b972fac 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -4216,17 +4216,17 @@ static void test_renderfile_failure(void)
 
     hr = IEnumFilters_Next(filterenum, 1, &filter, NULL);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
-    todo_wine ok(filter == &testfilter.IBaseFilter_iface, "Got unexpected filter %p.\n", filter);
+    ok(filter == &testfilter.IBaseFilter_iface, "Got unexpected filter %p.\n", filter);
 
     hr = IEnumFilters_Next(filterenum, 1, &filter, NULL);
-    todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+    ok(hr == S_FALSE, "Got hr %#x.\n", hr);
 
     IEnumFilters_Release(filterenum);
 
     ref = IFilterGraph2_Release(graph);
     ok(!ref, "Got outstanding refcount %d.\n", ref);
     ret = DeleteFileW(filename);
-    todo_wine ok(ret, "Failed to delete %s, error %u.\n", debugstr_w(filename), GetLastError());
+    ok(ret, "Failed to delete %s, error %u.\n", debugstr_w(filename), GetLastError());
 }
 
 /* Remove and re-add the filter, to flush the graph's internal




More information about the wine-cvs mailing list