Commit 388c5316 authored by Gijs Vermeulen's avatar Gijs Vermeulen Committed by Alexandre Julliard

amstream: Add graph to stream in IMediaStreamFilter::AddMediaStream().

parent 2d38551d
......@@ -497,6 +497,10 @@ static HRESULT WINAPI filter_AddMediaStream(IMediaStreamFilter *iface, IAMMediaS
if (FAILED(hr))
return hr;
hr = IAMMediaStream_JoinFilterGraph(pAMMediaStream, This->graph);
if (FAILED(hr))
return hr;
This->streams[This->nb_streams] = pAMMediaStream;
This->nb_streams++;
......
......@@ -686,6 +686,7 @@ static void test_add_stream(void)
IEnumFilters *enum_filters;
IBaseFilter *filters[3];
IGraphBuilder *graph;
FILTER_INFO info;
ULONG ref, count;
CLSID clsid;
HRESULT hr;
......@@ -755,13 +756,18 @@ static void test_add_stream(void)
hr = IAMMultiMediaStream_AddMediaStream(mmstream, (IUnknown *)&teststream, &IID_IUnknown, 0, &stream);
ok(hr == MS_E_PURPOSEID, "Got hr %#x.\n", hr);
hr = IMediaStreamFilter_QueryFilterInfo(stream_filter, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IAMMultiMediaStream_AddMediaStream(mmstream, (IUnknown *)&teststream, &test_mspid, 0, &stream);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(stream == (IMediaStream *)&teststream, "Streams didn't match.\n");
if (hr == S_OK) IMediaStream_Release(stream);
IMediaStream_Release(stream);
ok(teststream.mmstream == mmstream, "IAMMultiMediaStream objects didn't match.\n");
ok(teststream.filter == stream_filter, "IMediaStreamFilter objects didn't match.\n");
todo_wine ok(!!teststream.graph, "Expected a non-NULL graph.\n");
ok(teststream.graph == info.pGraph, "IFilterGraph objects didn't match.\n");
IFilterGraph_Release(info.pGraph);
check_enum_stream(mmstream, stream_filter, 0, video_stream);
check_enum_stream(mmstream, stream_filter, 1, audio_stream);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment