Commit dfa4c079 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz: Treat a filter as supporting IMediaSeeking only if it supports TIME_FORMAT_MEDIA_TIME.

parent 294de6f2
...@@ -585,6 +585,8 @@ static BOOL has_output_pins(IBaseFilter *filter) ...@@ -585,6 +585,8 @@ static BOOL has_output_pins(IBaseFilter *filter)
static void update_seeking(struct filter *filter) static void update_seeking(struct filter *filter)
{ {
IMediaSeeking *seeking;
if (!filter->seeking) if (!filter->seeking)
{ {
/* The Legend of Heroes: Trails of Cold Steel II destroys its filter when /* The Legend of Heroes: Trails of Cold Steel II destroys its filter when
...@@ -593,8 +595,13 @@ static void update_seeking(struct filter *filter) ...@@ -593,8 +595,13 @@ static void update_seeking(struct filter *filter)
* Some filters (e.g. MediaStreamFilter) can become seekable when they are * 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 * already in the graph, so always try to query IMediaSeeking if it's not
* cached yet. */ * cached yet. */
if (FAILED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaSeeking, (void **)&filter->seeking))) if (SUCCEEDED(IBaseFilter_QueryInterface(filter->filter, &IID_IMediaSeeking, (void **)&seeking)))
filter->seeking = NULL; {
if (IMediaSeeking_IsFormatSupported(seeking, &TIME_FORMAT_MEDIA_TIME) == S_OK)
filter->seeking = seeking;
else
IMediaSeeking_Release(seeking);
}
} }
} }
......
...@@ -3914,9 +3914,9 @@ static void test_ec_complete(void) ...@@ -3914,9 +3914,9 @@ static void test_ec_complete(void)
IFilterGraph2_AddFilter(graph, &filter1.IBaseFilter_iface, NULL); IFilterGraph2_AddFilter(graph, &filter1.IBaseFilter_iface, NULL);
hr = check_ec_complete(graph, &filter1.IBaseFilter_iface); 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); IFilterGraph2_RemoveFilter(graph, &filter1.IBaseFilter_iface);
filter1.IMediaSeeking_iface.lpVtbl = NULL; filter1.IMediaSeeking_iface.lpVtbl = NULL;
...@@ -4157,7 +4157,7 @@ static void test_graph_seeking(void) ...@@ -4157,7 +4157,7 @@ static void test_graph_seeking(void)
filter1.support_testguid = TRUE; filter1.support_testguid = TRUE;
hr = IMediaSeeking_GetDuration(seeking, &time); 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); hr = IMediaSeeking_SetTimeFormat(seeking, &testguid);
todo_wine ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr); todo_wine ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr);
...@@ -4269,8 +4269,8 @@ static void test_graph_seeking(void) ...@@ -4269,8 +4269,8 @@ static void test_graph_seeking(void)
hr = IMediaSeeking_GetCapabilities(seeking, &caps); hr = IMediaSeeking_GetCapabilities(seeking, &caps);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(caps == (AM_SEEKING_CanDoSegments | AM_SEEKING_CanGetDuration), "Got caps %#x.\n", caps); 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(!filter1.seeking_ref, "Unexpected seeking refcount %d.\n", filter1.seeking_ref);
ok(filter2.seeking_ref > 0, "Unexpected seeking refcount %d.\n", filter2.seeking_ref); ok(filter2.seeking_ref > 0, "Unexpected seeking refcount %d.\n", filter2.seeking_ref);
filter1.support_media_time = TRUE; filter1.support_media_time = TRUE;
......
...@@ -1156,7 +1156,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph) ...@@ -1156,7 +1156,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
hr = IMediaControl_GetState(control, 1000, &state); hr = IMediaControl_GetState(control, 1000, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ret = check_ec_complete(eventsrc, 0); ret = check_ec_complete(eventsrc, 0);
todo_wine ok(!ret, "Got unexpected EC_COMPLETE.\n"); ok(!ret, "Got unexpected EC_COMPLETE.\n");
hr = join_thread(send_frame(input)); hr = join_thread(send_frame(input));
todo_wine ok(hr == E_UNEXPECTED, "Got hr %#x.\n", hr); todo_wine ok(hr == E_UNEXPECTED, "Got hr %#x.\n", hr);
...@@ -1186,7 +1186,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph) ...@@ -1186,7 +1186,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
hr = IPin_EndOfStream(pin); hr = IPin_EndOfStream(pin);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ret = check_ec_complete(eventsrc, 0); ret = check_ec_complete(eventsrc, 0);
todo_wine ok(!ret, "Got unexpected EC_COMPLETE.\n"); ok(!ret, "Got unexpected EC_COMPLETE.\n");
ret = check_ec_complete(eventsrc, 1600); ret = check_ec_complete(eventsrc, 1600);
todo_wine ok(ret == 1, "Expected EC_COMPLETE.\n"); todo_wine ok(ret == 1, "Expected EC_COMPLETE.\n");
...@@ -1212,7 +1212,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph) ...@@ -1212,7 +1212,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
hr = IMediaControl_Stop(control); hr = IMediaControl_Stop(control);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ret = check_ec_complete(eventsrc, 0); ret = check_ec_complete(eventsrc, 0);
todo_wine ok(!ret, "Got unexpected EC_COMPLETE.\n"); ok(!ret, "Got unexpected EC_COMPLETE.\n");
/* Test sending EOS and then flushing or stopping. */ /* Test sending EOS and then flushing or stopping. */
...@@ -1226,7 +1226,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph) ...@@ -1226,7 +1226,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
hr = IPin_EndOfStream(pin); hr = IPin_EndOfStream(pin);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ret = check_ec_complete(eventsrc, 0); ret = check_ec_complete(eventsrc, 0);
todo_wine ok(!ret, "Got unexpected EC_COMPLETE.\n"); ok(!ret, "Got unexpected EC_COMPLETE.\n");
hr = IPin_BeginFlush(pin); hr = IPin_BeginFlush(pin);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment