Commit bd97b597 authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

amstream: Start the stream when AMMSF_RUN is passed to AMMultiMediaStream::OpenFile.

parent 6395c83d
......@@ -449,6 +449,9 @@ static HRESULT WINAPI multimedia_stream_OpenFile(IAMMultiMediaStream *iface,
IMediaStreamFilter_SupportSeeking(This->filter, This->type == STREAMTYPE_READ);
if (SUCCEEDED(ret) && (flags & AMMSF_RUN))
ret = IAMMultiMediaStream_SetState(iface, STREAMSTATE_RUN);
if (EnumPins)
IEnumPins_Release(EnumPins);
if (BaseFilter)
......
......@@ -271,8 +271,10 @@ static void test_interfaces(void)
static void test_openfile(const WCHAR *test_avi_path)
{
IAMMultiMediaStream *mmstream = create_ammultimediastream();
IMediaControl *media_control;
IMediaStreamFilter *filter;
IGraphBuilder *graph;
OAFilterState state;
HRESULT hr;
ULONG ref;
......@@ -308,6 +310,29 @@ static void test_openfile(const WCHAR *test_avi_path)
ok(!ref, "Got outstanding refcount %d.\n", ref);
ref = IMediaStreamFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
mmstream = create_ammultimediastream();
hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryAudio, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &graph);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!!graph, "Expected non-NULL graph.\n");
hr = IGraphBuilder_QueryInterface(graph, &IID_IMediaControl, (void **)&media_control);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, AMMSF_RUN);
ok(hr == S_OK, "Got hr %#x.\n", hr);
state = 0xdeadbeef;
hr = IMediaControl_GetState(media_control, INFINITE, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(state == State_Running, "Got state %#x.\n", state);
ref = IAMMultiMediaStream_Release(mmstream);
ok(!ref, "Got outstanding refcount %d.\n", ref);
IMediaControl_Release(media_control);
ref = IGraphBuilder_Release(graph);
ok(!ref, "Got outstanding refcount %d.\n", ref);
}
static void test_renderfile(const WCHAR *test_avi_path)
......
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