On 10/22/20 2:06 PM, Anton Baskanov wrote:
Signed-off-by: Anton Baskanov baskanov@gmail.com
dlls/amstream/multimedia.c | 11 +++++++++++ dlls/amstream/tests/amstream.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+)
diff --git a/dlls/amstream/multimedia.c b/dlls/amstream/multimedia.c index 967baacb747..f927cd106a0 100644 --- a/dlls/amstream/multimedia.c +++ b/dlls/amstream/multimedia.c @@ -472,6 +472,17 @@ static HRESULT WINAPI multimedia_stream_OpenFile(IAMMultiMediaStream *iface, } }
if (SUCCEEDED(ret) && (flags & AMMSF_NOCLOCK))
{
IMediaFilter *media_filter;
if (SUCCEEDED(ret = IGraphBuilder_QueryInterface(This->graph, &IID_IMediaFilter, (void **)&media_filter)))
{
ret = IMediaFilter_SetSyncSource(media_filter, NULL);
IMediaFilter_Release(media_filter);
}
}
IMediaStreamFilter_SupportSeeking(This->filter, This->type == STREAMTYPE_READ);
if (SUCCEEDED(ret) && (flags & AMMSF_RUN))
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index cb2b3dd76db..dbde4f6e20e 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -418,6 +418,8 @@ static void test_openfile(const WCHAR *test_avi_path) IAMMultiMediaStream *mmstream = create_ammultimediastream(); IMediaControl *media_control; IMediaStreamFilter *filter;
- IMediaFilter *media_filter;
- IReferenceClock *clock; IGraphBuilder *graph; OAFilterState state; HRESULT hr;
@@ -512,6 +514,34 @@ static void test_openfile(const WCHAR *test_avi_path) IMediaControl_Release(media_control); ref = IGraphBuilder_Release(graph); 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_IMediaFilter, (void **)&media_filter);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
- hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path, AMMSF_NOCLOCK);
- 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 = (IReferenceClock *)0xdeadbeef;
- IMediaFilter_GetSyncSource(media_filter, &clock);
- ok(!clock, "Got clock %p.\n", clock);
- 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);
}
static void test_mmstream_get_duration(const WCHAR *test_avi_path)
Can you please also check that the clock is otherwise non-NULL?