uridecodebin, urisourcebin: fix buffering for ssh:// URIs
authorTim-Philipp Müller <tim@centricular.com>
Thu, 16 May 2019 07:53:51 +0000 (08:53 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 22 May 2019 08:55:08 +0000 (09:55 +0100)
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.

gst/playback/gsturidecodebin.c
gst/playback/gsturisourcebin.c

index 6428f0b..943b3e7 100644 (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);
index a06e631..73a86c4 100644 (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);