[PATCH 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. -- 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..19bf7cc518f 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 && (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
Nikolay Sivov (@nsivov) commented about dlls/mf/session.c:
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 && (session->presentation.flags & SESSION_FLAG_NEEDS_PREROLL)
Could you add explicit != 0.0f? I think it will make it more obvious. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10054#note_129139
participants (3)
-
Brendan McGrath -
Brendan McGrath (@redmcg) -
Nikolay Sivov (@nsivov)