Module: wine Branch: master Commit: 2d88c5771611ad43767d19dc5b4fe990ec252304 URL: https://gitlab.winehq.org/wine/wine/-/commit/2d88c5771611ad43767d19dc5b4fe99...
Author: Rémi Bernon rbernon@codeweavers.com Date: Wed Jan 24 15:27:25 2024 +0100
mf/topology_loader: Try to connect transform nodes with their current types first.
And only if that fails try again by enumerating types.
---
dlls/mf/tests/mf.c | 4 ---- dlls/mf/topology_loader.c | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 2ca9d37abb6..ea801bf3af5 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -3705,17 +3705,13 @@ todo_wine { hr = IMFTopology_SetUINT32(full_topology, &IID_IMFTopology, 123); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IMFTopoLoader_Load(loader, full_topology, &topology2, NULL); - todo_wine_if(IsEqualGUID(&test->decoder_class, &CLSID_MSH264DecoderMFT)) ok(hr == S_OK, "Failed to resolve topology, hr %#lx.\n", hr); - if (hr == S_OK) - { ok(full_topology != topology2, "Unexpected instance.\n"); hr = IMFTopology_GetUINT32(topology2, &IID_IMFTopology, &value); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ref = IMFTopology_Release(topology2); ok(ref == 0, "Release returned %ld\n", ref); - } ref = IMFTopology_Release(full_topology); ok(ref == 0, "Release returned %ld\n", ref); } diff --git a/dlls/mf/topology_loader.c b/dlls/mf/topology_loader.c index 83398dbb12f..806f61f8c33 100644 --- a/dlls/mf/topology_loader.c +++ b/dlls/mf/topology_loader.c @@ -525,8 +525,11 @@ static HRESULT topology_loader_resolve_branches(struct topoloader_context *conte else if (FAILED(hr = topology_branch_clone_nodes(context, branch))) WARN("Failed to clone nodes for branch %s\n", debugstr_topology_branch(branch)); else - hr = topology_branch_connect(context->output_topology, MF_CONNECT_ALLOW_DECODER, - branch, enumerate_source_types || node_type == MF_TOPOLOGY_TRANSFORM_NODE); + { + hr = topology_branch_connect(context->output_topology, MF_CONNECT_ALLOW_DECODER, branch, enumerate_source_types); + if (hr == MF_E_INVALIDMEDIATYPE && !enumerate_source_types && node_type == MF_TOPOLOGY_TRANSFORM_NODE) + hr = topology_branch_connect(context->output_topology, MF_CONNECT_ALLOW_DECODER, branch, TRUE); + }
topology_branch_destroy(branch); if (FAILED(hr))