amstream: Set the multimedia stream graph in IAMMultiMediaStream::Initialize() only if a graph is specified.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-03-04 22:33:34 -06:00 committed by Alexandre Julliard
parent 8e4f8771af
commit 20004d1557
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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);