From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/mf/tests/mf.c | 4 ---- dlls/mf/topology.c | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index c447bad59e2..c46cfe600eb 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -6117,10 +6117,8 @@ static void test_MFGetTopoNodeCurrentType(void) hr = pMFGetTopoNodeCurrentType(node, 0, TRUE, &media_type); ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr); hr = pMFGetTopoNodeCurrentType(node, 1, TRUE, &media_type); - todo_wine ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr); hr = pMFGetTopoNodeCurrentType(node, 0, FALSE, &media_type); - todo_wine ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
hr = IMFTopologyNode_SetUnknown(node, &MF_TOPONODE_STREAM_DESCRIPTOR, (IUnknown *)input_descriptor); @@ -6146,10 +6144,8 @@ static void test_MFGetTopoNodeCurrentType(void) todo_wine ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); hr = pMFGetTopoNodeCurrentType(node, 1, FALSE, &media_type); - todo_wine ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr); hr = pMFGetTopoNodeCurrentType(node, 0, TRUE, &media_type); - todo_wine ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
stream_sink.handler = output_handler; diff --git a/dlls/mf/topology.c b/dlls/mf/topology.c index 8d64c10b5c7..34c20dbc735 100644 --- a/dlls/mf/topology.c +++ b/dlls/mf/topology.c @@ -1841,7 +1841,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 (output || stream) + return MF_E_INVALIDSTREAMNUMBER; + + if (SUCCEEDED(hr = topology_node_get_object(node, &IID_IMFStreamSink, (void **)&stream_sink))) { hr = IMFStreamSink_GetMediaTypeHandler(stream_sink, &type_handler); IMFStreamSink_Release(stream_sink); @@ -1854,6 +1857,9 @@ HRESULT WINAPI MFGetTopoNodeCurrentType(IMFTopologyNode *node, DWORD stream, BOO } break; case MF_TOPOLOGY_SOURCESTREAM_NODE: + if (!output || stream) + return MF_E_INVALIDSTREAMNUMBER; + if (FAILED(hr = IMFTopologyNode_GetUnknown(node, &MF_TOPONODE_STREAM_DESCRIPTOR, &IID_IMFStreamDescriptor, (void **)&sd))) {