Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/amstream/multimedia.c | 3 +++ dlls/amstream/tests/amstream.c | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
diff --git a/dlls/amstream/multimedia.c b/dlls/amstream/multimedia.c index b2c9082cae..200bd5c4a5 100644 --- a/dlls/amstream/multimedia.c +++ b/dlls/amstream/multimedia.c @@ -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) diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index b0450a0600..c0908545ce 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -273,8 +273,10 @@ static void test_interfaces(void)
static void test_openfile(const WCHAR *test_avi_path) { + IMediaControl *media_control; IMediaStreamFilter *filter; IAMMultiMediaStream *pams; + OAFilterState state; HRESULT hr; LONG ref; IGraphBuilder* pgraph; @@ -318,6 +320,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); + + pams = create_ammultimediastream(); + hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryAudio, 0, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IAMMultiMediaStream_GetFilterGraph(pams, &pgraph); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(pgraph != NULL, "Expected non-NULL graph.\n"); + hr = IGraphBuilder_QueryInterface(pgraph, &IID_IMediaControl, (void **)&media_control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAMMultiMediaStream_OpenFile(pams, 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(pams); + ok(!ref, "Got outstanding refcount %d.\n", ref); + IMediaControl_Release(media_control); + ref = IGraphBuilder_Release(pgraph); + ok(!ref, "Got outstanding refcount %d.\n", ref); }
static void test_renderfile(const WCHAR *test_avi_path)