From: Jonathan Matthew Date: Tue, 3 Nov 2020 12:39:54 +0000 (+1000) Subject: queue2: Fix modes in scheduling query handling X-Git-Tag: 1.19.3~679 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=146b2ddf507db81ce96e32427774e57ca76f15de;p=platform%2Fupstream%2Fgstreamer.git 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: --- 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);