session_request_sample() calls session_request_sample_from_node() and increments sink.requests only if that succeeds. But session_request_sample_from_node() calls session_deliver_sample_to_node() synchronously for MF_TOPOLOGY_TRANSFORM_NODE if there are output samples available. Then, if sink.requests is zero before this session_request_sample() call that sample is silently dropped.
It might not be easily noticeable currently, but I have a patchset which implements _ProcessMessage(MFT_MESSAGE_COMMAND_DRAIN) needed for some games (and also improving end of playback by fully delivering output including few last frames). And currently if session_deliver_sample_to_node() performs drain and that drain produces any samples we get a data sample processed but end marker silently dropped resulting in hanging session. That market gets to session_request_sample / session_request_sample_from_node but gets dropped in session_deliver_sample_to_node due to the reason first patch is fixing.
Thus also the second patch. I am not sure it is strictly needed, but the current handling of that seems fragile to me, I suppose we shouldn't ever drop markers.
-- v2: mf/session: Avoid dropping samples delivered from transform in session_request_sample_from_node().