Commit d95d1132 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

mf/topology_loader: Initialize transform output type before adding converter.

Otherwise the next topology_branch_connect call will fail when it will try to lookup the upstream element media type.
parent 2a185126
......@@ -3633,10 +3633,7 @@ todo_wine {
}
hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type);
todo_wine
ok(hr == S_OK, "Failed to get transform input type, hr %#lx.\n", hr);
if (hr == S_OK)
{
if (IsEqualGUID(&test->converter_class, &GUID_NULL))
{
hr = IMFMediaType_Compare(output_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &ret);
......@@ -3648,7 +3645,6 @@ todo_wine {
check_media_type(media_type, *test->decoded_type, -1);
}
IMFMediaType_Release(media_type);
}
IMFTransform_Release(transform);
}
......
......@@ -297,6 +297,7 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
struct topology_branch down_branch = {.up.node = node, .down = branch->down};
struct topology_branch up_branch = {.up = branch->up, .down.node = node};
MF_CONNECT_METHOD method = method_mask;
IMFMediaType *media_type;
if (FAILED(IMFActivate_ActivateObject(activates[i], &IID_IMFTransform, (void **)&transform)))
continue;
......@@ -315,6 +316,14 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
}
IMFTransform_Release(transform);
if (SUCCEEDED(hr) && method != MF_CONNECT_DIRECT
&& SUCCEEDED(IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type)))
{
if (SUCCEEDED(topology_branch_fill_media_type(up_type, media_type)))
IMFTransform_SetOutputType(transform, 0, media_type, 0);
IMFMediaType_Release(media_type);
}
if (SUCCEEDED(hr))
hr = topology_branch_connect(topology, method, &down_branch, !down_type);
if (SUCCEEDED(hr))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment