On Tue Nov 19 08:38:35 2024 +0000, Rémi Bernon wrote:
Well that's maybe yet another issue but not what I meant. What I think is happening is related to the `SESSION_FLAG_PENDING_COMMAND` that is used at https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/mf/session.c?ref_type... to decide whether to append the async call to a list or whether to request a new async call from the thread pool. The flag is set at https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/mf/session.c?ref_type..., so before processing `SESSION_CMD_START`, which calls BeginGetEvent and Start on the media sources at https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/mf/session.c?ref_type.... If `IMFMediaSource_Start` is returning an error immediately (if the source has been shutdown before the call), the flag is correctly cleared with `session_command_complete_with_event` at https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/mf/session.c?ref_type.... If the call doesn't return an error, but the source is shutdown before it has executed its async command, the media session never completes its command and never clear that flag because `MESourceStarted` is never received, and `session_set_source_object_state` never called.
With the changes I've made, `MESourceStarted` should be received even if the source is shutdown before the start async command executes. Is that sufficient to solve that issue?