Fixes: 114832224fc5babd1417562dbd64d489fabe1e01 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49604 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 4 ++-- dlls/quartz/tests/filtergraph.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 3b06d32c20a..db432b7dd95 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -2398,7 +2398,7 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG * EnterCriticalSection(&graph->cs);
state = graph->state; - if (state == State_Running) + if (state == State_Running && !graph->needs_async_run) IMediaControl_Pause(&graph->IMediaControl_iface);
LIST_FOR_EACH_ENTRY(filter, &graph->filters, struct filter, entry) @@ -2434,7 +2434,7 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG * graph->stream_elapsed = 0; }
- if (state == State_Running) + if (state == State_Running && !graph->needs_async_run) IMediaControl_Run(&graph->IMediaControl_iface);
LeaveCriticalSection(&graph->cs); diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 4fcd27b2918..cf641a4306e 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3205,9 +3205,10 @@ static void test_filter_state(void) struct testpin source_pin, sink_pin;
IFilterGraph2 *graph = create_graph(); - REFERENCE_TIME start_time; + REFERENCE_TIME start_time, time; IReferenceClock *clock; IMediaControl *control; + IMediaSeeking *seeking; FILTER_STATE mf_state; IMediaFilter *filter; OAFilterState state; @@ -3219,6 +3220,7 @@ static void test_filter_state(void) testfilter_init(&source, &source_pin, 1); testfilter_init(&sink, &sink_pin, 1); testfilter_init(&dummy, NULL, 0); + sink.IMediaSeeking_iface.lpVtbl = &testseek_vtbl;
IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&filter); IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); @@ -3350,6 +3352,7 @@ static void test_filter_state(void) graph = create_graph(); IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&filter); IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + IFilterGraph2_QueryInterface(graph, &IID_IMediaSeeking, (void **)&seeking);
/* Add the filters in reverse order this time. */ IFilterGraph2_AddFilter(graph, &sink.IBaseFilter_iface, NULL); @@ -3511,6 +3514,13 @@ todo_wine ok(sink.state == State_Paused, "Got state %u.\n", sink.state); ok(source.state == State_Paused, "Got state %u.\n", source.state);
+ /* SetPositions() does not pause the graph in this case, since it is + * already in a paused state. */ + time = 0; + hr = IMediaSeeking_SetPositions(seeking, &time, AM_SEEKING_AbsolutePositioning, + NULL, AM_SEEKING_NoPositioning); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IMediaControl_Run(control); todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@@ -3684,6 +3694,7 @@ todo_wine source.expect_stop_prev = sink.expect_stop_prev = State_Running; IMediaFilter_Release(filter); IMediaControl_Release(control); + IMediaSeeking_Release(seeking); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); ok(source.ref == 1, "Got outstanding refcount %d.\n", source.ref);