Nikolay Sivov (@nsivov) commented about dlls/mf/session.c:
WARN("Drain command failed for transform, hr %#lx.\n", hr); }
transform_node_pull_samples(session, topo_node);
hr = transform_node_pull_samples(session, topo_node);
if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT && !drain)
{
if (SUCCEEDED(IMFTopologyNode_GetInput(node, input, &upstream_node, &upstream_output)))
{
session_request_sample_from_node(session, upstream_node, upstream_output);
IMFTopologyNode_Release(upstream_node);
}
}
In general we don't really know which input branch to request from. That's why there is a fixme in session_request_sample_from_node() in similar logic. When ProcessOutput() returns need-more-input it means currently accumulated input samples across all inputs are not enough to produce any output. I suspect it could be caching per-input MF_E_NOTACCEPTING status, and trying to balance requests. Anyway, my point is that, I suspect, logic here should be the same as logic in session_request_sample_from_node(). Probably another helper would be in order.
Also, please add new request call under else branch of the following 'drain' check.