amstream: Forbid changing the graph in IAMMultiMediaStream::Initialize().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
20004d1557
commit
fa62cde374
|
@ -244,6 +244,12 @@ static HRESULT WINAPI multimedia_stream_Initialize(IAMMultiMediaStream *iface,
|
|||
|
||||
TRACE("mmstream %p, type %u, flags %#x, graph %p.\n", mmstream, type, flags, graph);
|
||||
|
||||
if (graph && mmstream->graph)
|
||||
{
|
||||
WARN("Graph already initialized, returning E_INVALIDARG.\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (graph && FAILED(hr = create_graph(mmstream, graph)))
|
||||
return hr;
|
||||
|
||||
|
|
|
@ -1646,6 +1646,15 @@ static void test_initialize(void)
|
|||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(!got_add_filter, "Got %d calls to IGraphBuilder::AddFilter().\n", got_add_filter);
|
||||
|
||||
hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_READ, 0, (IGraphBuilder *)&graph);
|
||||
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||
hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_READ, 0, NULL);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_WRITE, 0, NULL);
|
||||
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||
hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_TRANSFORM, 0, NULL);
|
||||
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||
|
||||
IMediaStreamFilter_Release(filter);
|
||||
ref = IAMMultiMediaStream_Release(mmstream);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
|
|
Loading…
Reference in New Issue