mf/session: Ensure that the command callback does not return without clearing SESSION_FLAG_PENDING_COMMAND.
Leaving SESSION_FLAG_PENDING_COMMAND set results in no more work items being queued by session_submit_command, and even if they were, callback would return immediately due to a check at the start of the function. Thus, it is never valid to leave the function without clearing the SESSION_FLAG_PENDING_COMMAND flag.
This case can be hit by SESSION_CMD_START, and leaves the session unable to process any commands.
Fix this by ensuring that SESSION_FLAG_PENDING_COMMAND is always cleared before the command callback returns.
From: Torge Matthies openglfreak@googlemail.com
Leaving SESSION_FLAG_PENDING_COMMAND set results in no more work items being queued by session_submit_command, and even if they were, callback would return immediately due to a check at the start of the function. Thus, it is never valid to leave the function without clearing the SESSION_FLAG_PENDING_COMMAND flag.
This case can be hit by SESSION_CMD_START, and leaves the session unable to process any commands.
Fix this by ensuring that SESSION_FLAG_PENDING_COMMAND is always cleared before the command callback returns. --- dlls/mf/session.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 3c989249229..da8e0bb824a 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -2725,7 +2725,6 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, break; case SESSION_CMD_SET_TOPOLOGY: session_set_topology(session, op->set_topology.flags, op->set_topology.topology); - session_command_complete(session); break; case SESSION_CMD_START: session_start(session, &op->start.time_format, &op->start.start_position); @@ -2744,12 +2743,14 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, break; case SESSION_CMD_SHUTDOWN: session_clear_command_list(session); - session_command_complete(session); break; default: ; }
+ if (session->presentation.flags & SESSION_FLAG_PENDING_COMMAND) + session_command_complete(session); + LeaveCriticalSection(&session->cs);
IUnknown_Release(&op->IUnknown_iface);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=146872
Your paranoid android.
=== debian11 (32 bit report) ===
mf: mf.c:6253: Test failed: Unexpected hr 0xc00d36b2.
=== debian11b (64 bit WoW report) ===
mfmediaengine: mfmediaengine.c:2336: Test succeeded inside todo block: Got unexpected refcount 0. mfmediaengine.c:2564: Test failed: Waiting for seeked event returned 0x102. mfmediaengine.c:2564: Test failed: Waiting for ready event returned 0x102. mfmediaengine.c:2570: Test failed: Waiting for seeked event returned 0x102. mfmediaengine.c:2570: Test failed: Waiting for ready event returned 0x102. mfmediaengine.c:2576: Test failed: Waiting for seeked event returned 0x102. mfmediaengine.c:2576: Test failed: Waiting for ready event returned 0x102. mfmediaengine.c:2576: Test failed: Unexpected time 0.000000. mfmediaengine.c:2581: Test failed: Waiting for seeked event returned 0x102. mfmediaengine.c:2581: Test failed: Waiting for ready event returned 0x102. mfmediaengine.c:2586: Test failed: Waiting for seeked event returned 0x102. mfmediaengine.c:2586: Test failed: Waiting for ready event returned 0x102. mfmediaengine.c:2586: Test failed: Unexpected time 0.000000. mfmediaengine.c:2635: Test succeeded inside todo block: Got unexpected refcount 0.
mf: mf.c:6253: Test failed: Unexpected hr 0xc00d36b2.
user32: win.c:4037: Test failed: Expected active window 0000000006370172, got 0000000003DB0182. win.c:4038: Test failed: Expected focus window 0000000006370172, got 0000000003DB0182.