From 146b2ddf507db81ce96e32427774e57ca76f15de Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Tue, 3 Nov 2020 22:39:54 +1000 Subject: [PATCH] queue2: Fix modes in scheduling query handling Create a new query to send upstream and copy the flags across from it, rather than reusing the same query, as this allows us to prevent use of pull mode when we don't have a download file. Fixes: #629 Part-of: --- plugins/elements/gstqueue2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 20cca1c..cb230b3 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -3490,11 +3490,16 @@ gst_queue2_handle_src_query (GstPad * pad, GstObject * parent, GstQuery * query) { gboolean pull_mode; GstSchedulingFlags flags = 0; + GstQuery *upstream; - if (!gst_pad_peer_query (queue->sinkpad, query)) + upstream = gst_query_new_scheduling (); + if (!gst_pad_peer_query (queue->sinkpad, upstream)) { + gst_query_unref (upstream); goto peer_failed; + } - gst_query_parse_scheduling (query, &flags, NULL, NULL, NULL); + gst_query_parse_scheduling (upstream, &flags, NULL, NULL, NULL); + gst_query_unref (upstream); /* we can operate in pull mode when we are using a tempfile */ pull_mode = !QUEUE_IS_USING_QUEUE (queue); -- 2.7.4