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.
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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 483ea6f904f..a9213d2cf18 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -1014,8 +1014,13 @@ static void session_flush_nodes(struct media_session *session) { if (node->type == MF_TOPOLOGY_OUTPUT_NODE) IMFStreamSink_Flush(node->object.sink_stream); - else if (node->type == MF_TOPOLOGY_TRANSFORM_NODE) + else if (node->type == MF_TOPOLOGY_TRANSFORM_NODE) { + UINT i; + 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 016c68f98b8..de599139736 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)