From: Rémi Bernon rbernon@codeweavers.com
It was introduced in !607 to avoid submitting commands while presentation is ending, although we have SESSION_FLAG_PENDING_COMMAND for that as well. In next commit we will want to preempt the end of presentation with the stop command. --- dlls/mf/session.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index b2371763150..2e1c5c6882c 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -215,7 +215,6 @@ enum presentation_flags SESSION_FLAG_NEEDS_PREROLL = 0x8, SESSION_FLAG_END_OF_PRESENTATION = 0x10, SESSION_FLAG_PENDING_RATE_CHANGE = 0x20, - SESSION_FLAG_PENDING_COMMAND = 0x40, };
struct media_session @@ -460,7 +459,7 @@ static HRESULT session_submit_command(struct media_session *session, struct sess EnterCriticalSection(&session->cs); if (SUCCEEDED(hr = session_is_shut_down(session))) { - if (list_empty(&session->commands) && !(session->presentation.flags & SESSION_FLAG_PENDING_COMMAND)) + if (list_empty(&session->commands)) hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_STANDARD, &session->commands_callback, &op->IUnknown_iface); if (op->command == SESSION_CMD_SHUTDOWN) list_add_head(&session->commands, &op->entry); @@ -849,8 +848,6 @@ static void session_command_complete(struct media_session *session) struct session_op *op; struct list *e;
- session->presentation.flags &= ~SESSION_FLAG_PENDING_COMMAND; - /* Submit next command. */ if ((e = list_head(&session->commands))) { @@ -2524,16 +2521,14 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface,
EnterCriticalSection(&session->cs);
- if (session->presentation.flags & SESSION_FLAG_PENDING_COMMAND) + if ((session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION)) { - WARN("session %p command is in progress, waiting for it to complete.\n", session); + WARN("session %p command is ending, waiting for it to complete.\n", session); LeaveCriticalSection(&session->cs); return S_OK; }
list_remove(&op->entry); - session->presentation.flags |= SESSION_FLAG_PENDING_COMMAND; - switch (op->command) { case SESSION_CMD_CLEAR_TOPOLOGIES: @@ -3521,7 +3516,7 @@ static void session_raise_end_of_presentation(struct media_session *session) { if (session_nodes_is_mask_set(session, MF_TOPOLOGY_MAX, SOURCE_FLAG_END_OF_PRESENTATION)) { - session->presentation.flags |= SESSION_FLAG_END_OF_PRESENTATION | SESSION_FLAG_PENDING_COMMAND; + session->presentation.flags |= SESSION_FLAG_END_OF_PRESENTATION; IMFMediaEventQueue_QueueEventParamVar(session->event_queue, MEEndOfPresentation, &GUID_NULL, S_OK, NULL); } }