From: Anton Baskanov baskanov@gmail.com
Signed-off-by: Anton Baskanov baskanov@gmail.com Signed-off-by: Zebediah Figura z.figura12@gmail.com --- v3: Rebase.
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 b2c9082cae0..200bd5c4a5e 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 8338a5a3ecf..8adf9db9347 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -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)