Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48715 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 11 +++++++++-- dlls/quartz/tests/filtergraph.c | 10 +++++----- 2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index e5ae12d9452..0f22bb5888c 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -585,6 +585,8 @@ static BOOL has_output_pins(IBaseFilter *filter)
static void update_seeking(struct filter *filter) { + IMediaSeeking *seeking; + if (!filter->seeking) { /* The Legend of Heroes: Trails of Cold Steel II destroys its filter when @@ -593,8 +595,13 @@ static void update_seeking(struct filter *filter) * Some filters (e.g. MediaStreamFilter) can become seekable when they are * already in the graph, so always try to query IMediaSeeking if it's not * cached yet. */ - if (FAILED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaSeeking, (void **)&filter->seeking))) - filter->seeking = NULL; + if (SUCCEEDED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaSeeking, (void **)&seeking))) + { + if (IMediaSeeking_IsFormatSupported(seeking, &TIME_FORMAT_MEDIA_TIME) == S_OK) + filter->seeking = seeking; + else + IMediaSeeking_Release(seeking); + } } }
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index ba63853ec7b..20a730f6aa0 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3914,9 +3914,9 @@ static void test_ec_complete(void) IFilterGraph2_AddFilter(graph, &filter1.IBaseFilter_iface, NULL);
hr = check_ec_complete(graph, &filter1.IBaseFilter_iface); - todo_wine ok(hr == E_ABORT, "Got hr %#x.\n", hr); + ok(hr == E_ABORT, "Got hr %#x.\n", hr);
- todo_wine ok(filter1.seeking_ref == 0, "Unexpected seeking refcount %d.\n", filter1.seeking_ref); + ok(filter1.seeking_ref == 0, "Unexpected seeking refcount %d.\n", filter1.seeking_ref); IFilterGraph2_RemoveFilter(graph, &filter1.IBaseFilter_iface);
filter1.IMediaSeeking_iface.lpVtbl = NULL; @@ -4157,7 +4157,7 @@ static void test_graph_seeking(void) filter1.support_testguid = TRUE;
hr = IMediaSeeking_GetDuration(seeking, &time); - todo_wine ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr);
hr = IMediaSeeking_SetTimeFormat(seeking, &testguid); todo_wine ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); @@ -4269,8 +4269,8 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_GetCapabilities(seeking, &caps); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(caps == (AM_SEEKING_CanDoSegments | AM_SEEKING_CanGetDuration), "Got caps %#x.\n", caps); - todo_wine ok(!filter1.seeking_ref, "Unexpected seeking refcount %d.\n", filter1.seeking_ref); + ok(caps == (AM_SEEKING_CanDoSegments | AM_SEEKING_CanGetDuration), "Got caps %#x.\n", caps); + ok(!filter1.seeking_ref, "Unexpected seeking refcount %d.\n", filter1.seeking_ref); ok(filter2.seeking_ref > 0, "Unexpected seeking refcount %d.\n", filter2.seeking_ref);
filter1.support_media_time = TRUE;