From: Conor McCarthy <cmccarthy@codeweavers.com> --- dlls/quartz/filtergraph.c | 21 ++++++++++++++------- dlls/quartz/tests/filtergraph.c | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index efe604530db..b449ef3c32c 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -5057,6 +5057,17 @@ static HRESULT WINAPI MediaFilter_GetClassID(IMediaFilter *iface, CLSID * pClass return E_NOTIMPL; } +static void graph_update_positions(struct filter_graph *graph) +{ + if (graph->state == State_Running && !graph->needs_async_run && graph->refClock) + { + REFERENCE_TIME time; + IReferenceClock_GetTime(graph->refClock, &time); + graph->stream_elapsed += time - graph->stream_start; + graph->current_pos += graph->stream_elapsed; + } +} + static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface) { struct filter_graph *graph = impl_from_IMediaFilter(iface); @@ -5076,6 +5087,8 @@ static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface) sort_filters(graph); + graph_update_positions(graph); + if (graph->state == State_Running) { LIST_FOR_EACH_ENTRY(filter, &graph->filters, struct filter, entry) @@ -5135,13 +5148,7 @@ static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface) if (graph->defaultclock && !graph->refClock) IFilterGraph2_SetDefaultSyncSource(&graph->IFilterGraph2_iface); - if (graph->state == State_Running && !graph->needs_async_run && graph->refClock) - { - REFERENCE_TIME time; - IReferenceClock_GetTime(graph->refClock, &time); - graph->stream_elapsed += time - graph->stream_start; - graph->current_pos += graph->stream_elapsed; - } + graph_update_positions(graph); LIST_FOR_EACH_ENTRY(filter, &graph->filters, struct filter, entry) { diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 4402f1cb1a1..dde4da0655c 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -5120,7 +5120,7 @@ static void test_graph_seeking(void) { todo_wine ok(compare_time(filter1.seek_current, 1334 * 10000, 80 * 10000), "Expected about 1334ms, got %I64d.\n", filter1.seek_current); - todo_wine ok(compare_time(filter2.seek_current, 1334 * 10000, 80 * 10000), + ok(compare_time(filter2.seek_current, 1334 * 10000, 80 * 10000), "Expected about 1334ms, got %I64d.\n", filter2.seek_current); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11050