Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/amstream/tests/amstream.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index db2d6e977ca..1480f723a1c 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -462,7 +462,7 @@ static void test_openfile(const WCHAR *test_avi_path)
check_interface(filter, &IID_IMediaSeeking, FALSE);
- hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, 0); + hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, AMMSF_RENDERTOEXISTING); ok(hr == VFW_E_CANNOT_CONNECT, "Got hr %#x.\n", hr);
check_interface(filter, &IID_IMediaSeeking, FALSE); @@ -489,7 +489,7 @@ static void test_openfile(const WCHAR *test_avi_path)
check_interface(filter, &IID_IMediaSeeking, FALSE);
- hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, 0); + hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, AMMSF_RENDERTOEXISTING); ok(hr == S_OK, "Got hr %#x.\n", hr);
check_interface(filter, &IID_IMediaSeeking, TRUE); @@ -585,7 +585,7 @@ static void test_mmstream_get_duration(const WCHAR *test_avi_path) ok(hr == S_OK || hr == VFW_E_NO_AUDIO_HARDWARE, "Got hr %#x.\n", hr); audio_hr = hr;
- hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, 0); + hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, AMMSF_RENDERTOEXISTING); ok(hr == S_OK, "Got hr %#x.\n", hr);
duration = 0xdeadbeefdeadbeefULL; @@ -618,7 +618,7 @@ static void test_mmstream_get_duration(const WCHAR *test_avi_path)
mmstream = create_ammultimediastream();
- hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, 0); + hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, AMMSF_RENDERTOEXISTING); ok(hr == VFW_E_CANNOT_CONNECT, "Got hr %#x.\n", hr);
duration = 0xdeadbeefdeadbeefULL; @@ -1778,7 +1778,7 @@ static void test_media_streams(void) }
/* Test open file with no filename */ - hr = IAMMultiMediaStream_OpenFile(pams, NULL, 0); + hr = IAMMultiMediaStream_OpenFile(pams, NULL, AMMSF_RENDERTOEXISTING); ok(hr == E_POINTER, "IAMMultiMediaStream_OpenFile returned %x instead of %x\n", hr, E_POINTER);
if (video_stream)
Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/amstream/multimedia.c | 5 +++- dlls/amstream/tests/amstream.c | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/dlls/amstream/multimedia.c b/dlls/amstream/multimedia.c index 6bac95a243b..98ffc95a54a 100644 --- a/dlls/amstream/multimedia.c +++ b/dlls/amstream/multimedia.c @@ -471,9 +471,12 @@ static HRESULT WINAPI multimedia_stream_OpenFile(IAMMultiMediaStream *iface,
if (SUCCEEDED(ret = IGraphBuilder_QueryInterface(This->graph, &IID_IFilterGraph2, (void **)&graph))) { - ret = IFilterGraph2_RenderEx(graph, This->ipin, AM_RENDEREX_RENDERTOEXISTINGRENDERERS, NULL); + DWORD renderflags = (flags & AMMSF_RENDERALLSTREAMS) ? 0 : AM_RENDEREX_RENDERTOEXISTINGRENDERERS; + + ret = IFilterGraph2_RenderEx(graph, This->ipin, renderflags, NULL); if (ret == VFW_E_CANNOT_RENDER) ret = VFW_E_CANNOT_CONNECT; else if (ret == VFW_S_PARTIAL_RENDER) ret = S_OK; + IFilterGraph2_Release(graph); } else diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 1480f723a1c..a43eec77ec2 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -451,6 +451,50 @@ static void test_openfile(const WCHAR *test_avi_path) ref = IAMMultiMediaStream_Release(mmstream); ok(!ref, "Got outstanding refcount %d.\n", ref);
+ mmstream = create_ammultimediastream(); + + hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &graph); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(!graph, "Expected NULL graph.\n"); + + hr = IAMMultiMediaStream_GetFilter(mmstream, &filter); + ok(!!filter, "Expected non-NULL filter.\n"); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + check_interface(filter, &IID_IMediaSeeking, FALSE); + + hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, AMMSF_RENDERALLSTREAMS); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + check_interface(filter, &IID_IMediaSeeking, FALSE); + + 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_IMediaFilter, (void **)&media_filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + clock = NULL; + IMediaFilter_GetSyncSource(media_filter, &clock); + ok(!!clock, "Expected non-NULL clock.\n"); + + hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + ref = IAMMultiMediaStream_Release(mmstream); + ok(!ref, "Got outstanding refcount %d.\n", ref); + IMediaFilter_Release(media_filter); + ref = IGraphBuilder_Release(graph); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IMediaStreamFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IReferenceClock_Release(clock); + ok(!ref, "Got outstanding refcount %d.\n", ref); + mmstream = create_ammultimediastream(); hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &graph); ok(hr == S_OK, "Got hr %#x.\n", hr);
Signed-off-by: Zebediah Figura zfigura@codeweavers.com