[PATCH] mf: Unconditionally deliver NULL (EOS) samples.

Derek Lesho dlesho at codeweavers.com
Wed Oct 14 11:13:12 CDT 2020


Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
---
Without this, I observed the pipeline locking up when a stream had two transforms, the first with the final sample, and the second with an empty sample queue.  Calling session_request_sample would end up calling session_deliver_sample_to_node() for the EOS sample, but the second transform wouldn't accept it due to there being no requests.  This behavior seems to match session_deliver_sample_to_node's output node behavior, where the request count is only checked if the sample isn't NULL.
---
 dlls/mf/session.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/mf/session.c b/dlls/mf/session.c
index a1b54b7080e..7c82aa42a4b 100644
--- a/dlls/mf/session.c
+++ b/dlls/mf/session.c
@@ -2599,11 +2599,12 @@ static void session_deliver_sample_to_node(struct media_session *session, IMFTop
                 LIST_FOR_EACH_ENTRY_SAFE(sample_entry, sample_entry2, &topo_node->u.transform.outputs[i].samples,
                         struct sample, entry)
                 {
-                    if (!topo_node->u.transform.outputs[i].requests)
+                    if (!topo_node->u.transform.outputs[i].requests && sample_entry->sample)
                         break;
 
                     session_deliver_sample_to_node(session, downstream_node, downstream_input, sample_entry->sample);
-                    topo_node->u.transform.outputs[i].requests--;
+                    if (sample_entry->sample)
+                        topo_node->u.transform.outputs[i].requests--;
 
                     transform_release_sample(sample_entry);
                 }
-- 
2.28.0




More information about the wine-devel mailing list