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 <sagawa.aki@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2021-12-10 23:58:15 +09:00 committed by Alexandre Julliard
parent b650e768be
commit bbdb658402
1 changed files with 1 additions and 1 deletions

View File

@ -5044,7 +5044,7 @@ static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
if (graph->defaultclock && !graph->refClock) if (graph->defaultclock && !graph->refClock)
IFilterGraph2_SetDefaultSyncSource(&graph->IFilterGraph2_iface); 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; REFERENCE_TIME time;
IReferenceClock_GetTime(graph->refClock, &time); IReferenceClock_GetTime(graph->refClock, &time);