From 20004d1557651b27f23e78223edabb654a2c55cc Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 4 Mar 2020 22:33:34 -0600 Subject: [PATCH] amstream: Set the multimedia stream graph in IAMMultiMediaStream::Initialize() only if a graph is specified. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/amstream/multimedia.c | 2 +- dlls/amstream/tests/amstream.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/amstream/multimedia.c b/dlls/amstream/multimedia.c index 43e3ee9057f..9ca38d9fa43 100644 --- a/dlls/amstream/multimedia.c +++ b/dlls/amstream/multimedia.c @@ -244,7 +244,7 @@ static HRESULT WINAPI multimedia_stream_Initialize(IAMMultiMediaStream *iface, TRACE("mmstream %p, type %u, flags %#x, graph %p.\n", mmstream, type, flags, graph); - if (FAILED(hr = create_graph(mmstream, graph))) + if (graph && FAILED(hr = create_graph(mmstream, graph))) return hr; mmstream->type = type; diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 511cd1eaddf..3555eff9704 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -1504,7 +1504,7 @@ static void test_initialize(void) ret_graph = (IGraphBuilder *)0xdeadbeef; hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(!ret_graph, "Got unexpected graph %p.\n", ret_graph); + ok(!ret_graph, "Got unexpected graph %p.\n", ret_graph); hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo, 0, &stream); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -1538,7 +1538,7 @@ static void test_initialize(void) ret_graph = (IGraphBuilder *)0xdeadbeef; hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(!ret_graph, "Got unexpected graph %p.\n", ret_graph); + ok(!ret_graph, "Got unexpected graph %p.\n", ret_graph); hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo, 0, &stream); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -1566,7 +1566,7 @@ static void test_initialize(void) ret_graph = (IGraphBuilder *)0xdeadbeef; hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(!ret_graph, "Got unexpected graph %p.\n", ret_graph); + ok(!ret_graph, "Got unexpected graph %p.\n", ret_graph); hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo, 0, &stream); ok(hr == S_OK, "Got hr %#x.\n", hr);