From 4642de1d6c9e287a25d1609630335e6d599cd5fc Mon Sep 17 00:00:00 2001 From: Akihiro Sagawa Date: Fri, 10 Dec 2021 23:58:15 +0900 Subject: [PATCH] quartz: Fix a race in IMediaFilter::Pause(). Before finishing async run, graph->stream_start isn't stable. This will cause graph->current_pos to be out of playback duration. Since graph->current_pos is out of the range, the playback will be stopped. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52200 Signed-off-by: Akihiro Sagawa Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard (cherry picked from commit bbdb6584026393ef1159bd841b61abcad0f1e247) Signed-off-by: Michael Stefaniuc --- dlls/quartz/filtergraph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 20eec80e00c..e6eea7e18ac 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -5038,7 +5038,7 @@ static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface) if (graph->defaultclock && !graph->refClock) IFilterGraph2_SetDefaultSyncSource(&graph->IFilterGraph2_iface); - if (graph->state == State_Running && graph->refClock) + if (graph->state == State_Running && !graph->needs_async_run && graph->refClock) { REFERENCE_TIME time; IReferenceClock_GetTime(graph->refClock, &time);