discoverer: Ensure that we have fixed, non-empty caps before passing passing to is_su...
authorSebastian Dröge <sebastian@centricular.com>
Wed, 6 May 2020 08:44:39 +0000 (11:44 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 6 May 2020 08:51:00 +0000 (11:51 +0300)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/655>

gst-libs/gst/pbutils/gstdiscoverer.c

index 7dfd7ee..b27f89a 100644 (file)
@@ -712,7 +712,8 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
   if (sinkpad == NULL)
     goto error;
 
-  if (is_subtitle_caps (caps)) {
+  if (caps && !gst_caps_is_empty (caps) && !gst_caps_is_any (caps)
+      && is_subtitle_caps (caps)) {
     /* Subtitle streams are sparse and may not provide any information - don't
      * wait for data to preroll */
     ps->probe_id =
@@ -722,7 +723,8 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
     dc->priv->pending_subtitle_pads++;
   }
 
-  gst_caps_unref (caps);
+  if (caps)
+    gst_caps_unref (caps);
 
   gst_bin_add_many (dc->priv->pipeline, ps->queue, ps->sink, NULL);