uridecodebin, urisourcebin: fix buffering for ssh:// URIs

Protocols that are in the stream_uris list should always
be streams, no matter what they respond to the scheduling
query. The flag in the scheduling query is just another
way to declare something that needs buffering without the
whitelist, the absence of the flag shouldn't make us ignore
our known protocol list.

Also set is_stream always to a boolean and not a mask value.
This commit is contained in:
Tim-Philipp Müller 2019-05-16 08:53:51 +01:00
parent 51f2d05ff6
commit b87f830700
2 changed files with 10 additions and 6 deletions

View file

@ -1310,12 +1310,14 @@ gen_source_element (GstURIDecodeBin * decoder)
GST_LOG_OBJECT (decoder, "found source type %s", G_OBJECT_TYPE_NAME (source));
decoder->is_stream = IS_STREAM_URI (decoder->uri);
query = gst_query_new_scheduling ();
if (gst_element_query (source, query)) {
gst_query_parse_scheduling (query, &flags, NULL, NULL, NULL);
decoder->is_stream = flags & GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED;
} else
decoder->is_stream = IS_STREAM_URI (decoder->uri);
if ((flags & GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED))
decoder->is_stream = TRUE;
}
gst_query_unref (query);
GST_LOG_OBJECT (decoder, "source is stream: %d", decoder->is_stream);

View file

@ -1429,12 +1429,14 @@ gen_source_element (GstURISourceBin * urisrc)
GST_LOG_OBJECT (urisrc, "found source type %s", G_OBJECT_TYPE_NAME (source));
urisrc->is_stream = IS_STREAM_URI (urisrc->uri);
query = gst_query_new_scheduling ();
if (gst_element_query (source, query)) {
gst_query_parse_scheduling (query, &flags, NULL, NULL, NULL);
urisrc->is_stream = flags & GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED;
} else
urisrc->is_stream = IS_STREAM_URI (urisrc->uri);
if ((flags & GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED))
urisrc->is_stream = TRUE;
}
gst_query_unref (query);
GST_LOG_OBJECT (urisrc, "source is stream: %d", urisrc->is_stream);