[PATCH v2 0/1] MR10054: mf: Don't perform preroll if we are scrubbing.
Tests on Windows show that a preroll isn't requested by the media session if rate is zero. This MR changes media session to match that behaviour. -- v2: mf: Don't perform preroll if we are scrubbing. https://gitlab.winehq.org/wine/wine/-/merge_requests/10054
From: Brendan McGrath <bmcgrath@codeweavers.com> --- dlls/mf/session.c | 3 ++- dlls/mf/tests/mf.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 3257418a574..0e263993deb 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -3212,7 +3212,8 @@ static void session_set_source_object_state(struct media_session *session, IUnkn session_set_presentation_clock(session); - if ((session->presentation.flags & SESSION_FLAG_NEEDS_PREROLL) && session_is_output_nodes_state(session, OBJ_STATE_STOPPED)) + if (session->presentation.rate != 0.0f && (session->presentation.flags & SESSION_FLAG_NEEDS_PREROLL) + && session_is_output_nodes_state(session, OBJ_STATE_STOPPED)) { MFTIME preroll_time = 0; diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 8707a27fed7..85cfb1f63dc 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -10373,7 +10373,6 @@ static void test_media_session_scrubbing(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = WaitForSingleObject(media_sink->preroll_event, 100); - todo_wine ok(hr == WAIT_TIMEOUT, "Unexpected hr %#lx.\n", hr); todo_wine -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10054
On Mon Feb 9 09:05:06 2026 +0000, Brendan McGrath wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/10054/diffs?diff_id=243298&start_sha=8aeebd9983220810854963690abf6f7408d82bd6#7183a816d94669947cd265eb6a492656655bbde4_3215_3215) OK, that's done.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10054#note_129143
v2: - add explicit != 0.0f to if condition -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10054#note_129145
This merge request was approved by Nikolay Sivov. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10054
participants (3)
-
Brendan McGrath -
Brendan McGrath (@redmcg) -
Nikolay Sivov (@nsivov)