If a session is paused then started again, or if a start position is provided we wait forever for the source to send a MESourceStarted event, when it sends a MESourceSeeked instead.
This causes a deadlock in Bright Memory: Infinite as the game then waits for the Start command to complete, while the session is stuck in the SESSION_STATE_STARTING_SOURCES state.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/mf/session.c | 8 ++++++++ dlls/mfplat/tests/mfplat.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 05b7af81df7..6ee3c454c6e 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -2295,6 +2295,8 @@ static enum object_state session_get_object_state_for_event(MediaEventType event { switch (event) { + case MESourceSeeked: + case MEStreamSeeked: case MESourceStarted: case MEStreamStarted: case MEStreamSinkStarted: @@ -2471,6 +2473,7 @@ static void session_set_source_object_state(struct media_session *session, IUnkn
switch (event_type) { + case MESourceSeeked: case MESourceStarted: case MESourcePaused: case MESourceStopped: @@ -2485,6 +2488,7 @@ static void session_set_source_object_state(struct media_session *session, IUnkn } } break; + case MEStreamSeeked: case MEStreamStarted: case MEStreamPaused: case MEStreamStopped: @@ -3172,6 +3176,10 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM
switch (event_type) { + case MESourceSeeked: + case MEStreamSeeked: + FIXME("Source/stream seeking, semi-stub!\n"); + /* fallthrough */ case MESourceStarted: case MESourcePaused: case MESourceStopped: diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index c70d8a9ca81..cabcc1b06b0 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -942,6 +942,44 @@ static void test_source_resolver(void) video_stream = (IMFMediaStream *)var.punkVal; }
+ hr = IMFMediaSource_Pause(mediasource); + ok(hr == S_OK, "Failed to pause media source, hr %#x.\n", hr); + if (get_event((IMFMediaEventGenerator *)mediasource, MESourcePaused, &var)) + ok(var.vt == VT_EMPTY, "Unexpected value type.\n"); + + var.vt = VT_EMPTY; + hr = IMFMediaSource_Start(mediasource, descriptor, &GUID_NULL, &var); + ok(hr == S_OK, "Failed to start media source, hr %#x.\n", hr); + + if (get_event((IMFMediaEventGenerator *)mediasource, MESourceStarted, &var)) + ok(var.vt == VT_EMPTY, "Unexpected value type.\n"); + + hr = IMFMediaSource_Pause(mediasource); + ok(hr == S_OK, "Failed to pause media source, hr %#x.\n", hr); + if (get_event((IMFMediaEventGenerator *)mediasource, MESourcePaused, &var)) + ok(var.vt == VT_EMPTY, "Unexpected value type.\n"); + + var.vt = VT_I8; + var.uhVal.QuadPart = 0; + hr = IMFMediaSource_Start(mediasource, descriptor, &GUID_NULL, &var); + ok(hr == S_OK, "Failed to start media source, hr %#x.\n", hr); + + if (get_event((IMFMediaEventGenerator *)mediasource, MESourceSeeked, &var)) + ok(var.vt == VT_I8, "Unexpected value type.\n"); + + hr = IMFMediaSource_Stop(mediasource); + ok(hr == S_OK, "Failed to pause media source, hr %#x.\n", hr); + if (get_event((IMFMediaEventGenerator *)mediasource, MESourceStopped, &var)) + ok(var.vt == VT_EMPTY, "Unexpected value type.\n"); + + var.vt = VT_I8; + var.uhVal.QuadPart = 0; + hr = IMFMediaSource_Start(mediasource, descriptor, &GUID_NULL, &var); + ok(hr == S_OK, "Failed to start media source, hr %#x.\n", hr); + + if (get_event((IMFMediaEventGenerator *)mediasource, MESourceStarted, &var)) + ok(var.vt == VT_I8, "Unexpected value type.\n"); + sample_count = 10;
for (i = 0; i < sample_count; ++i)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=107726
Your paranoid android.
=== w7u_el (32 bit report) ===
mfplat: 085c:mfplat: unhandled exception c0000005 at 6EDD7D1C