We don't actually need to, because we'll wait for the callback when stopping the graph.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49907 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index e2e293ebfb9..9e385052315 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -1837,7 +1837,6 @@ static void CALLBACK async_run_cb(TP_CALLBACK_INSTANCE *instance, void *context, }
LeaveCriticalSection(&graph->cs); - IUnknown_Release(graph->outer_unk); }
static HRESULT WINAPI MediaControl_Run(IMediaControl *iface) @@ -1897,7 +1896,6 @@ static HRESULT WINAPI MediaControl_Run(IMediaControl *iface) if (!graph->async_run_work) graph->async_run_work = CreateThreadpoolWork(async_run_cb, graph, NULL); graph->needs_async_run = 1; - IUnknown_AddRef(graph->outer_unk); SubmitThreadpoolWork(graph->async_run_work); } else @@ -5017,9 +5015,8 @@ static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
LeaveCriticalSection(&graph->cs);
- /* Don't cancel the callback; it's holding a reference to the graph. */ if (work) - WaitForThreadpoolWorkCallbacks(work, FALSE); + WaitForThreadpoolWorkCallbacks(work, TRUE);
return hr; } @@ -5068,9 +5065,8 @@ static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
LeaveCriticalSection(&graph->cs);
- /* Don't cancel the callback; it's holding a reference to the graph. */ if (work) - WaitForThreadpoolWorkCallbacks(work, FALSE); + WaitForThreadpoolWorkCallbacks(work, TRUE);
return hr; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/filtergraph.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 127bf3463f5..0bdaf13951b 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3613,6 +3613,27 @@ todo_wine ok(sink.state == State_Stopped, "Got state %u.\n", sink.state); ok(source.state == State_Stopped, "Got state %u.\n", source.state);
+ /* Same, but tear down the graph instead. */ + + sink.state_hr = S_FALSE; + sink.GetState_hr = VFW_S_STATE_INTERMEDIATE; + hr = IMediaControl_Run(control); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + IMediaFilter_Release(filter); + IMediaControl_Release(control); + IMediaSeeking_Release(seeking); + ref = IFilterGraph2_Release(graph); + ok(!ref, "Got outstanding refcount %d.\n", ref); + + graph = create_graph(); + IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&filter); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + IFilterGraph2_QueryInterface(graph, &IID_IMediaSeeking, (void **)&seeking); + IFilterGraph2_AddFilter(graph, &sink.IBaseFilter_iface, NULL); + IFilterGraph2_AddFilter(graph, &source.IBaseFilter_iface, NULL); + IPin_Connect(&source_pin.IPin_iface, &sink_pin.IPin_iface, NULL); + /* This logic doesn't apply when using IMediaFilter methods directly. */
source.expect_run_prev = sink.expect_run_prev = State_Stopped; @@ -3692,11 +3713,6 @@ todo_wine hr = IMediaControl_Run(control); ok(hr == S_OK, "Got hr %#x.\n", hr); check_filter_state(graph, State_Running); -todo_wine - ok(source.start_time > 0 && source.start_time < 500 * 10000, - "Got time %s.\n", wine_dbgstr_longlong(source.start_time)); - ok(sink.start_time == source.start_time, "Expected time %s, got %s.\n", - wine_dbgstr_longlong(source.start_time), wine_dbgstr_longlong(sink.start_time));
source.expect_stop_prev = sink.expect_stop_prev = State_Running; IMediaFilter_Release(filter);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=81548
Your paranoid android.
=== w10pro64_ar (64 bit report) ===
quartz: filtergraph.c:3545: Test failed: Got state 2. filtergraph.c:3546: Test failed: Got state 2.
=== debiant (32 bit Chinese:China report) ===
quartz: videorenderer.c:2103: Test failed: Got unexpected message 0x21.