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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/693>
This commit is contained in:
Jonathan Matthew 2020-11-03 22:39:54 +10:00 committed by GStreamer Merge Bot
parent 96ac9abb23
commit 146b2ddf50

View file

@ -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);