From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/mf/tests/mf.c | 6 +----- dlls/mf/topology.c | 13 +++---------- 2 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index eaac991566b..615767296b1 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -6017,7 +6017,6 @@ static void test_MFGetTopoNodeCurrentType(void) hr = MFCreateTopologyNode(MF_TOPOLOGY_OUTPUT_NODE, &node); ok(hr == S_OK, "Failed to create a node, hr %#lx.\n", hr); hr = pMFGetTopoNodeCurrentType(node, 0, FALSE, &media_type); - todo_wine ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); hr = pMFGetTopoNodeCurrentType(node, 1, FALSE, &media_type); todo_wine @@ -6029,17 +6028,14 @@ static void test_MFGetTopoNodeCurrentType(void) hr = IMFTopologyNode_SetObject(node, (IUnknown *)output_handler); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = pMFGetTopoNodeCurrentType(node, 0, FALSE, &media_type); - todo_wine ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#lx.\n", hr);
- media_type = NULL; hr = IMFMediaTypeHandler_SetCurrentMediaType(output_handler, input_types[0]); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = pMFGetTopoNodeCurrentType(node, 0, FALSE, &media_type); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(media_type == input_types[0], "Unexpected pointer.\n"); - if (media_type) IMFMediaType_Release(media_type); + IMFMediaType_Release(media_type);
ref = IMFTopologyNode_Release(node); ok(ref == 0, "Release returned %ld\n", ref); diff --git a/dlls/mf/topology.c b/dlls/mf/topology.c index 8d64c10b5c7..f4c28e747db 100644 --- a/dlls/mf/topology.c +++ b/dlls/mf/topology.c @@ -1827,7 +1827,6 @@ HRESULT WINAPI MFGetTopoNodeCurrentType(IMFTopologyNode *node, DWORD stream, BOO { IMFMediaTypeHandler *type_handler; MF_TOPOLOGY_TYPE node_type; - IMFStreamSink *stream_sink; IMFStreamDescriptor *sd; IMFTransform *transform; UINT32 primary_output; @@ -1841,16 +1840,10 @@ HRESULT WINAPI MFGetTopoNodeCurrentType(IMFTopologyNode *node, DWORD stream, BOO switch (node_type) { case MF_TOPOLOGY_OUTPUT_NODE: - if (SUCCEEDED(topology_node_get_object(node, &IID_IMFStreamSink, (void **)&stream_sink))) + if (SUCCEEDED(hr = topology_node_get_object(node, &IID_IMFMediaTypeHandler, (void **)&type_handler))) { - hr = IMFStreamSink_GetMediaTypeHandler(stream_sink, &type_handler); - IMFStreamSink_Release(stream_sink); - - if (SUCCEEDED(hr)) - { - hr = IMFMediaTypeHandler_GetCurrentMediaType(type_handler, type); - IMFMediaTypeHandler_Release(type_handler); - } + hr = IMFMediaTypeHandler_GetCurrentMediaType(type_handler, type); + IMFMediaTypeHandler_Release(type_handler); } break; case MF_TOPOLOGY_SOURCESTREAM_NODE: