On Wed Aug 6 11:34:46 2025 +0000, Rémi Bernon wrote:
From a quick look I guess it's possible that it does, if media source is shutdown while `command_state` is already `COMMAND_STATE_COMPLETE` and the next command has just been submitted but not yet started execution. I suppose `session_command_complete` should perhaps check `op->submitted` before submitting it again, or we need another `COMMAND_STATE_SUBMITTED` state to replace the per-command submitted flag entirely?
Adding `COMMAND_STATE_SUBMITTED` makes more sense to me.
I'll close this MR, since your refactoring already fixed the memory bug this MR was originally about. I'll open another MR for the new problem.
Though this new problem is much harder to test since it now genuinely requires a race condition. :/