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

Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Anton Baskanov 2020-07-21 10:50:07 -05:00 committed by Alexandre Julliard
parent 6395c83d2a
commit bd97b597e6
2 changed files with 28 additions and 0 deletions

View File

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

View File

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