[PATCH v5 4/8] mf: Check that sink nodes must have been activated in _Load.
Sergio Gómez Del Real
sdelreal at codeweavers.com
Wed Apr 22 22:28:31 CDT 2020
Signed-off-by: Sergio Gómez Del Real <sdelreal at codeweavers.com>
---
dlls/mf/tests/mf.c | 1 -
dlls/mf/topology.c | 13 +++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index d375a3f8e5..33c33f9a7c 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -1735,7 +1735,6 @@ static void test_topology_loader(void)
/* Sink was not resolved. */
hr = IMFTopoLoader_Load(loader, topology, &full_topology, NULL);
-todo_wine
ok(hr == MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED, "Unexpected hr %#x.\n", hr);
hr = IMFActivate_ActivateObject(sink_activate, &IID_IMFMediaSink, (void **)&sink);
diff --git a/dlls/mf/topology.c b/dlls/mf/topology.c
index daeea397d5..ce107d05f2 100644
--- a/dlls/mf/topology.c
+++ b/dlls/mf/topology.c
@@ -1920,6 +1920,7 @@ static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *in
struct topology_node *(*node_pairs)[2];
struct topology *full_topology;
IMFTopology *topology_clone;
+ IMFStreamSink *sink;
int num_connections;
HRESULT hr;
int i, idx;
@@ -1992,6 +1993,18 @@ static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *in
}
}
+ /* all sinks must be activated */
+ for (i = 0; i < num_connections; i++)
+ {
+ if (FAILED(hr = IUnknown_QueryInterface(node_pairs[i][1]->object, &IID_IMFStreamSink, (void **)&sink)))
+ {
+ hr = MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED;
+ FIXME("Check for MF_CONNECT_AS_OPTIONAL and MF_CONNECT_AS_OPTIONAL_BRANCH flags.\n");
+ goto out;
+ }
+ IMFStreamSink_Release(sink);
+ }
+
*output_topology = &full_topology->IMFTopology_iface;
hr = S_OK;
out:
--
2.17.1
More information about the wine-devel
mailing list