Before this, stopping and restarting the media session could cause MFT streams to get stuck in the "already pending" state, which would lead to no more samples getting delivered.
This also reverts 18c0dd7390b354d2e505e54cd3f3f9b08226b265, my previous attempt to fix the problem which for some reason seemed to help - but with the new fix, it does not make any difference.
The reverted commit is faulty since the Flush() method - which is called at session Stop, but runs after sample_grabber_set_state - already releases pending items, while processing markers immediately.
Sorry for the trouble.
-- v2: Revert "mf: Release pending items when sample grabber is stopped." mf: Clear pending MFT stream requests when flushing.
From: Charlotte Pabst cpabst@codeweavers.com
Before this, stopping and restarting the media session could cause MFT streams to get stuck in the "already pending" state, which would lead to no more samples getting delivered. --- dlls/mf/session.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 483ea6f904f..47760cc44a7 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -1009,13 +1009,19 @@ static HRESULT session_subscribe_sources(struct media_session *session) static void session_flush_nodes(struct media_session *session) { struct topo_node *node; + UINT i;
LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry) { if (node->type == MF_TOPOLOGY_OUTPUT_NODE) IMFStreamSink_Flush(node->object.sink_stream); else if (node->type == MF_TOPOLOGY_TRANSFORM_NODE) + { + for (i = 0; i < node->u.transform.output_count; ++i) + node->u.transform.outputs[i].requests = 0; + IMFTransform_ProcessMessage(node->object.transform, MFT_MESSAGE_COMMAND_FLUSH, 0); + } } }
From: Charlotte Pabst cpabst@codeweavers.com
This reverts commit 18c0dd7390b354d2e505e54cd3f3f9b08226b265.
The actual bug that broke sample delivery was in mf session code.
This commit is faulty since the Flush() method - which is called at session Stop, but runs after sample_grabber_set_state - already releases pending items, while processing markers immediately. --- dlls/mf/samplegrabber.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index 964f4e9001e..a8c797f25ed 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -1191,7 +1191,6 @@ static HRESULT sample_grabber_set_state(struct sample_grabber *grabber, enum sin sample_grabber_cancel_timer(grabber); release_samples(grabber); grabber->sample_count = MAX_SAMPLE_QUEUE_LENGTH; - sample_grabber_release_pending_items(grabber); }
if (state == SINK_STATE_RUNNING && grabber->state != SINK_STATE_RUNNING)
On Wed Jun 18 16:34:51 2025 +0000, Nikolay Sivov wrote:
Please apply this formatting change to the first commit, but otherwise sure, let's try it. [fmt.diff](/uploads/c024bde2e0f1eb269c580f2a7dc08d07/fmt.diff)
done!
This merge request was approved by Nikolay Sivov.